@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | |
5 | 5 | Route::view('/', "admin::home")->name('home'); |
6 | 6 | |
7 | -Route::post('/logout', function (){ |
|
7 | +Route::post('/logout', function() { |
|
8 | 8 | auth()->logout(); |
9 | 9 | return redirect(config('easy_panel.redirect_unauthorized')); |
10 | 10 | })->name('logout'); |
@@ -12,9 +12,9 @@ discard block |
||
12 | 12 | |
13 | 13 | function registerActionRoutes($action, $component, $crudConfig) |
14 | 14 | { |
15 | - Route::prefix($action)->name("$action.")->group(function () use ($component, $crudConfig, $action) { |
|
15 | + Route::prefix($action)->name("$action.")->group(function() use ($component, $crudConfig, $action) { |
|
16 | 16 | |
17 | - if(@class_exists("$component\\Read")) { |
|
17 | + if (@class_exists("$component\\Read")) { |
|
18 | 18 | Route::get('/', "$component\\Read")->name('read'); |
19 | 19 | } |
20 | 20 | |
@@ -23,21 +23,21 @@ discard block |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | if ($crudConfig['update'] and @class_exists("$component\\Update")) { |
26 | - Route::get('/update/{' . $action . '}', "$component\\Update")->name('update'); |
|
26 | + Route::get('/update/{'.$action.'}', "$component\\Update")->name('update'); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | }); |
30 | 30 | } |
31 | 31 | |
32 | -foreach (config('easy_panel.actions') as $action){ |
|
32 | +foreach (config('easy_panel.actions') as $action) { |
|
33 | 33 | $crudConfig = config('easy_panel.crud.'.$action); |
34 | 34 | $name = ucfirst($action); |
35 | 35 | $component = "App\\Http\\Livewire\\Admin\\$name"; |
36 | 36 | registerActionRoutes($action, $component, $crudConfig); |
37 | 37 | } |
38 | 38 | |
39 | -if(config('easy_panel.todo')){ |
|
40 | - Route::prefix('todo')->name('todo.')->group(function (){ |
|
39 | +if (config('easy_panel.todo')) { |
|
40 | + Route::prefix('todo')->name('todo.')->group(function() { |
|
41 | 41 | Route::get('/', \EasyPanel\Http\Livewire\Todo\Lists::class)->name('lists'); |
42 | 42 | Route::get('/create', \EasyPanel\Http\Livewire\Todo\Create::class)->name('create'); |
43 | 43 | }); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | |
22 | 22 | public function handle() |
23 | 23 | { |
24 | - if(!$this->option()){ |
|
24 | + if (!$this->option()) { |
|
25 | 25 | $this->info("model option must have a value"); |
26 | 26 | return; |
27 | 27 | } |
@@ -33,16 +33,16 @@ discard block |
||
33 | 33 | |
34 | 34 | $path = resource_path("cruds/{$name}.php"); |
35 | 35 | |
36 | - if (! $this->files->isDirectory(dirname($path))) { |
|
36 | + if (!$this->files->isDirectory(dirname($path))) { |
|
37 | 37 | $this->files->makeDirectory(dirname($path), 0755, true); |
38 | 38 | } |
39 | 39 | |
40 | - if($this->files->exists($path) and !$this->option('force')){ |
|
40 | + if ($this->files->exists($path) and !$this->option('force')) { |
|
41 | 41 | $this->warn("'{$name}' exists in CRUDs config"); |
42 | 42 | return; |
43 | 43 | } |
44 | 44 | |
45 | - if($name != strtolower($this->option('model'))){ |
|
45 | + if ($name != strtolower($this->option('model'))) { |
|
46 | 46 | $this->warn("'{$name}' must be equal to model name"); |
47 | 47 | return; |
48 | 48 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | { |
56 | 56 | $model = $this->qualifyModel($this->option('model')); |
57 | 57 | |
58 | - if(!class_exists($model)){ |
|
58 | + if (!class_exists($model)) { |
|
59 | 59 | $this->warn("Model option should be valid and model should be exist"); |
60 | 60 | die(); |
61 | 61 | } |