feat: add uploader
This commit is contained in:
29
modules/Common/Repository/Options/Controllers.php
Normal file
29
modules/Common/Repository/Options/Controllers.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Common\Repository\Options;
|
||||
|
||||
use Catch\CatchAdmin;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class Controllers implements OptionInterface
|
||||
{
|
||||
public function get(): array
|
||||
{
|
||||
$controllers = [];
|
||||
|
||||
if ($module = request()->get('module')) {
|
||||
$controllerFiles = File::glob(CatchAdmin::getModuleControllerPath($module).'*.php');
|
||||
|
||||
foreach ($controllerFiles as $controllerFile) {
|
||||
$controllers[] = [
|
||||
'label' => Str::of(File::name($controllerFile))->lcfirst()->remove('Controller'),
|
||||
|
||||
'value' => Str::of(File::name($controllerFile))->lcfirst()->remove('Controller'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return $controllers;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user