@@ -17,10 +17,10 @@ |
||
17 | 17 | public function handle() |
18 | 18 | { |
19 | 19 | $user = $this->argument('user'); |
20 | - try{ |
|
20 | + try { |
|
21 | 21 | UserProviderFacade::makeAdmin($user); |
22 | 22 | $this->info("User {$user} was converted to an admin"); |
23 | - } catch (\Exception $exception){ |
|
23 | + } catch (\Exception $exception) { |
|
24 | 24 | $this->error("User {$user} does not exist"); |
25 | 25 | } |
26 | 26 | } |
@@ -12,7 +12,7 @@ |
||
12 | 12 | |
13 | 13 | public function handle($request, Closure $next) |
14 | 14 | { |
15 | - if(AuthFacade::checkIsAdmin(auth()->user()->id)){ |
|
15 | + if (AuthFacade::checkIsAdmin(auth()->user()->id)) { |
|
16 | 16 | return $next($request); |
17 | 17 | } |
18 | 18 |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('todos', function (Blueprint $table) { |
|
16 | + Schema::create('todos', function(Blueprint $table) { |
|
17 | 17 | $table->id(); |
18 | 18 | $table->unsignedBigInteger('user_id'); |
19 | 19 | $table->string('title'); |
@@ -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 | } |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | { |
19 | 19 | $user = $this->argument('user'); |
20 | 20 | |
21 | - if($this->askResult($user)){ |
|
21 | + if ($this->askResult($user)) { |
|
22 | 22 | UserProviderFacade::deleteAdmin($user); |
23 | 23 | $this->info('Admin was removed successfully'); |
24 | 24 | return; |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | public function askResult($user) |
31 | 31 | { |
32 | - if($this->option('force')) { |
|
32 | + if ($this->option('force')) { |
|
33 | 33 | return true; |
34 | 34 | } |
35 | 35 | $result = $this->confirm("Do you want to remove {$user} from administration", 'yes'); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | public function handle() |
17 | 17 | { |
18 | 18 | $names = (array) $this->argument('name') ?: config('easy_panel.actions', []); |
19 | - if($names == null) { |
|
19 | + if ($names == null) { |
|
20 | 20 | throw new CommandNotFoundException("There is no action in config file"); |
21 | 21 | } |
22 | 22 | |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | if ($this->askResult($name)) { |
30 | 30 | File::deleteDirectory(resource_path("/views/livewire/admin/$name")); |
31 | - File::deleteDirectory(app_path("/Http/Livewire/Admin/" . ucfirst($name))); |
|
31 | + File::deleteDirectory(app_path("/Http/Livewire/Admin/".ucfirst($name))); |
|
32 | 32 | $this->info("{$name} files were deleted, make sure you will delete {$name} value from actions in config"); |
33 | 33 | } else { |
34 | 34 | $this->line("process for {$name} action was canceled."); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | public function askResult($name) |
41 | 41 | { |
42 | - if($this->option('force')) { |
|
42 | + if ($this->option('force')) { |
|
43 | 43 | return true; |
44 | 44 | } |
45 | 45 | $result = $this->confirm("Do you really want to delete {$name} files ?", true); |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | { |
36 | 36 | public function register() |
37 | 37 | { |
38 | - $this->mergeConfigFrom(__DIR__ . '/../config/easy_panel_config.php', 'easy_panel'); |
|
39 | - if(!config('easy_panel.enable')) { |
|
38 | + $this->mergeConfigFrom(__DIR__.'/../config/easy_panel_config.php', 'easy_panel'); |
|
39 | + if (!config('easy_panel.enable')) { |
|
40 | 40 | return; |
41 | 41 | } |
42 | 42 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $this->bindCommands(); |
45 | 45 | |
46 | 46 | foreach (config('easy_panel.actions') as $action) { |
47 | - if(!File::exists(resource_path("cruds/$action.php"))) { |
|
47 | + if (!File::exists(resource_path("cruds/$action.php"))) { |
|
48 | 48 | continue; |
49 | 49 | } |
50 | 50 | $data = require resource_path("cruds/$action.php"); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | public function boot() |
56 | 56 | { |
57 | - if(!config('easy_panel.enable')) { |
|
57 | + if (!config('easy_panel.enable')) { |
|
58 | 58 | return; |
59 | 59 | } |
60 | 60 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | } |
64 | 64 | |
65 | 65 | // Load Views |
66 | - $this->loadViewsFrom(__DIR__ . '/../resources/views', 'admin'); |
|
66 | + $this->loadViewsFrom(__DIR__.'/../resources/views', 'admin'); |
|
67 | 67 | |
68 | 68 | // Register Middleware |
69 | 69 | $this->registerMiddlewareAlias(); |
@@ -77,11 +77,11 @@ discard block |
||
77 | 77 | |
78 | 78 | private function defineRoutes() |
79 | 79 | { |
80 | - if(!$this->app->routesAreCached()) { |
|
80 | + if (!$this->app->routesAreCached()) { |
|
81 | 81 | Route::prefix(config('easy_panel.route_prefix')) |
82 | 82 | ->middleware(['web', 'auth', 'isAdmin', 'LangChanger']) |
83 | - ->name(getRouteName() . '.') |
|
84 | - ->group(__DIR__ . '/routes.php'); |
|
83 | + ->name(getRouteName().'.') |
|
84 | + ->group(__DIR__.'/routes.php'); |
|
85 | 85 | } |
86 | 86 | } |
87 | 87 | |
@@ -107,13 +107,13 @@ discard block |
||
107 | 107 | |
108 | 108 | private function mergePublishes() |
109 | 109 | { |
110 | - $this->publishes([__DIR__ . '/../config/easy_panel_config.php' => config_path('easy_panel.php')], 'easy-panel-config'); |
|
110 | + $this->publishes([__DIR__.'/../config/easy_panel_config.php' => config_path('easy_panel.php')], 'easy-panel-config'); |
|
111 | 111 | |
112 | - $this->publishes([__DIR__ . '/../resources/views' => resource_path('/views/vendor/admin')], 'easy-panel-views'); |
|
112 | + $this->publishes([__DIR__.'/../resources/views' => resource_path('/views/vendor/admin')], 'easy-panel-views'); |
|
113 | 113 | |
114 | - $this->publishes([__DIR__ . '/../resources/assets' => public_path('/assets/admin')], 'easy-panel-styles'); |
|
114 | + $this->publishes([__DIR__.'/../resources/assets' => public_path('/assets/admin')], 'easy-panel-styles'); |
|
115 | 115 | |
116 | - $this->publishes([__DIR__ . '/../database/migrations/2020_09_05_99999_create_todos_table.php' => base_path('/database/migrations/' . date('Y_m_d') . '_99999_create_admin_todos_table.php')], 'easy-panel-migrations'); |
|
116 | + $this->publishes([__DIR__.'/../database/migrations/2020_09_05_99999_create_todos_table.php' => base_path('/database/migrations/'.date('Y_m_d').'_99999_create_admin_todos_table.php')], 'easy-panel-migrations'); |
|
117 | 117 | |
118 | 118 | $this->publishes([__DIR__.'/../resources/cruds' => resource_path('/cruds')], 'easy-panel-cruds'); |
119 | 119 |
@@ -32,7 +32,7 @@ |
||
32 | 32 | public function delete() |
33 | 33 | { |
34 | 34 | $this->todo->delete(); |
35 | - $this->dispatchBrowserEvent('show-message', ['type' => 'error', 'message' => __('DeletedMessage', ['name' => __('Todo') ] )]); |
|
35 | + $this->dispatchBrowserEvent('show-message', ['type' => 'error', 'message' => __('DeletedMessage', ['name' => __('Todo')])]); |
|
36 | 36 | $this->emit('todoDeleted'); |
37 | 37 | } |
38 | 38 |