@@ -37,10 +37,10 @@ discard block |
||
| 37 | 37 | public function register() |
| 38 | 38 | { |
| 39 | 39 | // Here we merge config with 'easy_panel' key |
| 40 | - $this->mergeConfigFrom(__DIR__ . '/../config/easy_panel_config.php', 'easy_panel'); |
|
| 40 | + $this->mergeConfigFrom(__DIR__.'/../config/easy_panel_config.php', 'easy_panel'); |
|
| 41 | 41 | |
| 42 | 42 | // Check the status of module |
| 43 | - if(!config('easy_panel.enable')) { |
|
| 43 | + if (!config('easy_panel.enable')) { |
|
| 44 | 44 | return; |
| 45 | 45 | } |
| 46 | 46 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | public function boot() |
| 52 | 52 | { |
| 53 | - if(!config('easy_panel.enable')) { |
|
| 53 | + if (!config('easy_panel.enable')) { |
|
| 54 | 54 | return; |
| 55 | 55 | } |
| 56 | 56 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | // Load Views with 'admin::' prefix |
| 67 | - $this->loadViewsFrom(__DIR__ . '/../resources/views', 'admin'); |
|
| 67 | + $this->loadViewsFrom(__DIR__.'/../resources/views', 'admin'); |
|
| 68 | 68 | |
| 69 | 69 | // Register Middleware |
| 70 | 70 | $this->registerMiddlewareAlias(); |
@@ -78,11 +78,11 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | private function defineRoutes() |
| 80 | 80 | { |
| 81 | - if(!$this->app->routesAreCached()) { |
|
| 81 | + if (!$this->app->routesAreCached()) { |
|
| 82 | 82 | Route::prefix(config('easy_panel.route_prefix')) |
| 83 | 83 | ->middleware(['web', 'auth', 'isAdmin', 'LangChanger']) |
| 84 | - ->name(getRouteName() . '.') |
|
| 85 | - ->group(__DIR__ . '/routes.php'); |
|
| 84 | + ->name(getRouteName().'.') |
|
| 85 | + ->group(__DIR__.'/routes.php'); |
|
| 86 | 86 | } |
| 87 | 87 | } |
| 88 | 88 | |
@@ -108,13 +108,13 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | private function mergePublishes() |
| 110 | 110 | { |
| 111 | - $this->publishes([__DIR__ . '/../config/easy_panel_config.php' => config_path('easy_panel.php')], 'easy-panel-config'); |
|
| 111 | + $this->publishes([__DIR__.'/../config/easy_panel_config.php' => config_path('easy_panel.php')], 'easy-panel-config'); |
|
| 112 | 112 | |
| 113 | - $this->publishes([__DIR__ . '/../resources/views' => resource_path('/views/vendor/admin')], 'easy-panel-views'); |
|
| 113 | + $this->publishes([__DIR__.'/../resources/views' => resource_path('/views/vendor/admin')], 'easy-panel-views'); |
|
| 114 | 114 | |
| 115 | - $this->publishes([__DIR__ . '/../resources/assets' => public_path('/assets/admin')], 'easy-panel-styles'); |
|
| 115 | + $this->publishes([__DIR__.'/../resources/assets' => public_path('/assets/admin')], 'easy-panel-styles'); |
|
| 116 | 116 | |
| 117 | - $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 | + $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'); |
|
| 118 | 118 | |
| 119 | 119 | $this->publishes([__DIR__.'/../resources/lang' => resource_path('/lang')], 'easy-panel-lang'); |
| 120 | 120 | |
@@ -23,26 +23,26 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | public function handle() |
| 25 | 25 | { |
| 26 | - if(!$this->option('model')){ |
|
| 26 | + if (!$this->option('model')) { |
|
| 27 | 27 | $this->error("Model option must have a value"); |
| 28 | 28 | return; |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | $name = strtolower($this->getNameInput()); |
| 32 | 32 | |
| 33 | - if($name != strtolower($this->option('model'))){ |
|
| 33 | + if ($name != strtolower($this->option('model'))) { |
|
| 34 | 34 | $this->warn("'{$name}' must be equal to model name"); |
| 35 | 35 | return; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | $path = resource_path("cruds/{$name}.php"); |
| 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}' already exists in CRUDs config"); |
| 42 | 42 | return; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - if (! $this->files->isDirectory(dirname($path))) { |
|
| 45 | + if (!$this->files->isDirectory(dirname($path))) { |
|
| 46 | 46 | $this->files->makeDirectory(dirname($path), 0755, true); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | { |
| 77 | 77 | $model = $this->qualifyModel($this->option('model')); |
| 78 | 78 | |
| 79 | - if(!class_exists($model)){ |
|
| 79 | + if (!class_exists($model)) { |
|
| 80 | 80 | $this->warn("Model option should be valid and model should be exist"); |
| 81 | 81 | die(); |
| 82 | 82 | } |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | private function withAuth() |
| 88 | 88 | { |
| 89 | 89 | $fillableList = $this->getFillableList(); |
| 90 | - if(!in_array('user_id', $fillableList)){ |
|
| 90 | + if (!in_array('user_id', $fillableList)) { |
|
| 91 | 91 | return 'true'; |
| 92 | 92 | } |
| 93 | 93 | |
@@ -105,8 +105,8 @@ discard block |
||
| 105 | 105 | { |
| 106 | 106 | $fillableList = $this->getFillableList(); |
| 107 | 107 | $array = []; |
| 108 | - foreach ($fillableList as $fillable){ |
|
| 109 | - if(!Str::contains($fillable, 'id')){ |
|
| 108 | + foreach ($fillableList as $fillable) { |
|
| 109 | + if (!Str::contains($fillable, 'id')) { |
|
| 110 | 110 | $array[] = "'$fillable'"; |
| 111 | 111 | } |
| 112 | 112 | } |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | |
| 51 | 51 | $path = $this->viewPath("livewire".DIRECTORY_SEPARATOR."admin".DIRECTORY_SEPARATOR."{$this->getNameInput()}".DIRECTORY_SEPARATOR."{$this->file}.blade.php"); |
| 52 | 52 | |
| 53 | - if (! $this->files->isDirectory(dirname($path))) { |
|
| 53 | + if (!$this->files->isDirectory(dirname($path))) { |
|
| 54 | 54 | $this->files->makeDirectory(dirname($path), 0755, true); |
| 55 | 55 | } |
| 56 | 56 | |