@@ -4,20 +4,20 @@ |
||
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'); |
11 | 11 | |
12 | -foreach (config('easy_panel.actions') as $action){ |
|
12 | +foreach (config('easy_panel.actions') as $action) { |
|
13 | 13 | $crudConfig = config('easy_panel.crud.'.$action); |
14 | 14 | $name = ucfirst($action); |
15 | 15 | $component = "App\\Http\\Livewire\\Admin\\$name"; |
16 | 16 | registerActionRoutes($action, $component, $crudConfig); |
17 | 17 | } |
18 | 18 | |
19 | -if(config('easy_panel.todo')){ |
|
20 | - Route::prefix('todo')->name('todo.')->group(function (){ |
|
19 | +if (config('easy_panel.todo')) { |
|
20 | + Route::prefix('todo')->name('todo.')->group(function() { |
|
21 | 21 | Route::get('/', \EasyPanel\Http\Livewire\Todo\Lists::class)->name('lists'); |
22 | 22 | Route::get('/create', \EasyPanel\Http\Livewire\Todo\Create::class)->name('create'); |
23 | 23 | }); |
@@ -18,7 +18,7 @@ |
||
18 | 18 | { |
19 | 19 | $admins = UserProviderFacade::getAdmins(); |
20 | 20 | $this->warn('Admin Lists :'); |
21 | - foreach ($admins as $admin){ |
|
21 | + foreach ($admins as $admin) { |
|
22 | 22 | $this->warn("• {$admin->name}: {$admin->email}"); |
23 | 23 | } |
24 | 24 | } |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if(! function_exists('getRouteName')) { |
|
4 | - function getRouteName(){ |
|
3 | +if (!function_exists('getRouteName')) { |
|
4 | + function getRouteName() { |
|
5 | 5 | $routeName = config('easy_panel.route_prefix'); |
6 | 6 | $routeName = trim($routeName, '/'); |
7 | 7 | $routeName = str_replace('/', '.', $routeName); |
@@ -9,8 +9,8 @@ discard block |
||
9 | 9 | } |
10 | 10 | } |
11 | 11 | |
12 | -if(! function_exists('get_icon')) { |
|
13 | - function get_icon($type){ |
|
12 | +if (!function_exists('get_icon')) { |
|
13 | + function get_icon($type) { |
|
14 | 14 | $array = [ |
15 | 15 | 'file-text' => ['posts', 'article', 'stories', 'post', 'articles', 'story'], |
16 | 16 | 'users' => ['users', 'user', 'accounts', 'account', 'admins', 'admin', 'employee', 'employees'], |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | 'music' => ['musics', 'music', 'audios', 'audio'], |
24 | 24 | 'bell' => ['notifications', 'notification'], |
25 | 25 | ]; |
26 | - foreach ($array as $key => $arrayValues){ |
|
27 | - if(in_array($type, $arrayValues)){ |
|
26 | + foreach ($array as $key => $arrayValues) { |
|
27 | + if (in_array($type, $arrayValues)) { |
|
28 | 28 | $val = $key; |
29 | 29 | } |
30 | 30 | } |
@@ -32,12 +32,12 @@ discard block |
||
32 | 32 | } |
33 | 33 | } |
34 | 34 | |
35 | -if(! function_exists('registerActionRoutes')){ |
|
35 | +if (!function_exists('registerActionRoutes')) { |
|
36 | 36 | function registerActionRoutes($action, $component, $crudConfig) |
37 | 37 | { |
38 | - Route::prefix($action)->name("$action.")->group(function () use ($component, $crudConfig, $action) { |
|
38 | + Route::prefix($action)->name("$action.")->group(function() use ($component, $crudConfig, $action) { |
|
39 | 39 | |
40 | - if(@class_exists("$component\\Read")) { |
|
40 | + if (@class_exists("$component\\Read")) { |
|
41 | 41 | Route::get('/', "$component\\Read")->name('read'); |
42 | 42 | } |
43 | 43 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | if (@$crudConfig['update'] and @class_exists("$component\\Update")) { |
49 | - Route::get('/update/{' . $action . '}', "$component\\Update")->name('update'); |
|
49 | + Route::get('/update/{'.$action.'}', "$component\\Update")->name('update'); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | }); |