@@ -15,7 +15,7 @@ |
||
| 15 | 15 | { |
| 16 | 16 | $admins = UserProviderFacade::getAdmins(); |
| 17 | 17 | $this->warn('Admin Lists :'); |
| 18 | - foreach ($admins as $admin){ |
|
| 18 | + foreach ($admins as $admin) { |
|
| 19 | 19 | $message = $admin->panelAdmin->is_superuser |
| 20 | 20 | ? "• {$admin->name}: {$admin->email} ( Super Admin ✅ )" |
| 21 | 21 | : "• {$admin->name}: {$admin->email}"; |
@@ -15,13 +15,13 @@ |
||
| 15 | 15 | public function handle() |
| 16 | 16 | { |
| 17 | 17 | $user = $this->argument('user'); |
| 18 | - try{ |
|
| 18 | + try { |
|
| 19 | 19 | $status = UserProviderFacade::makeAdmin($user, $this->option('super')); |
| 20 | 20 | $method = $status['type'] == 'success' ? 'info' : 'warn'; |
| 21 | 21 | |
| 22 | 22 | $this->$method($status['message']); |
| 23 | - } catch (\Exception $exception){ |
|
| 24 | - $this->warn("Something went wrong!\nError: ". $exception->getMessage()); |
|
| 23 | + } catch (\Exception $exception) { |
|
| 24 | + $this->warn("Something went wrong!\nError: ".$exception->getMessage()); |
|
| 25 | 25 | } |
| 26 | 26 | } |
| 27 | 27 | |
@@ -38,10 +38,10 @@ discard block |
||
| 38 | 38 | public function register() |
| 39 | 39 | { |
| 40 | 40 | // Here we merge config with 'easy_panel' key |
| 41 | - $this->mergeConfigFrom(__DIR__ . '/../config/easy_panel_config.php', 'easy_panel'); |
|
| 41 | + $this->mergeConfigFrom(__DIR__.'/../config/easy_panel_config.php', 'easy_panel'); |
|
| 42 | 42 | |
| 43 | 43 | // Check the status of module |
| 44 | - if(!config('easy_panel.enable')) { |
|
| 44 | + if (!config('easy_panel.enable')) { |
|
| 45 | 45 | return; |
| 46 | 46 | } |
| 47 | 47 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | public function boot() |
| 53 | 53 | { |
| 54 | - if(!config('easy_panel.enable')) { |
|
| 54 | + if (!config('easy_panel.enable')) { |
|
| 55 | 55 | return; |
| 56 | 56 | } |
| 57 | 57 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | $this->bindCommands(); |
| 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(); |
@@ -81,13 +81,13 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | private function defineRoutes() |
| 83 | 83 | { |
| 84 | - if(!$this->app->routesAreCached()) { |
|
| 84 | + if (!$this->app->routesAreCached()) { |
|
| 85 | 85 | $middlewares = array_merge(['web', 'isAdmin', 'LangChanger'], config('easy_panel.additional_middlewares')); |
| 86 | 86 | |
| 87 | 87 | Route::prefix(config('easy_panel.route_prefix')) |
| 88 | 88 | ->middleware($middlewares) |
| 89 | - ->name(getRouteName() . '.') |
|
| 90 | - ->group(__DIR__ . '/routes.php'); |
|
| 89 | + ->name(getRouteName().'.') |
|
| 90 | + ->group(__DIR__.'/routes.php'); |
|
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | |
@@ -117,17 +117,17 @@ discard block |
||
| 117 | 117 | |
| 118 | 118 | private function mergePublishes() |
| 119 | 119 | { |
| 120 | - $this->publishes([__DIR__ . '/../config/easy_panel_config.php' => config_path('easy_panel.php')], 'easy-panel-config'); |
|
| 120 | + $this->publishes([__DIR__.'/../config/easy_panel_config.php' => config_path('easy_panel.php')], 'easy-panel-config'); |
|
| 121 | 121 | |
| 122 | - $this->publishes([__DIR__ . '/../resources/views' => resource_path('/views/vendor/admin')], 'easy-panel-views'); |
|
| 122 | + $this->publishes([__DIR__.'/../resources/views' => resource_path('/views/vendor/admin')], 'easy-panel-views'); |
|
| 123 | 123 | |
| 124 | - $this->publishes([__DIR__ . '/../resources/assets' => public_path('/assets/admin')], 'easy-panel-styles'); |
|
| 124 | + $this->publishes([__DIR__.'/../resources/assets' => public_path('/assets/admin')], 'easy-panel-styles'); |
|
| 125 | 125 | |
| 126 | - $this->publishes([__DIR__ . '/../database/migrations/2020_09_05_999999_create_todos_table.php' => base_path('/database/migrations/' . date('Y_m_d') . '_999999_create_admin_todos_table.php')], 'easy-panel-todo'); |
|
| 126 | + $this->publishes([__DIR__.'/../database/migrations/2020_09_05_999999_create_todos_table.php' => base_path('/database/migrations/'.date('Y_m_d').'_999999_create_admin_todos_table.php')], 'easy-panel-todo'); |
|
| 127 | 127 | |
| 128 | 128 | $this->publishes([ |
| 129 | - __DIR__ . '/../database/migrations/2021_07_17_999999_create_cruds_table.php' => base_path('/database/migrations/' . date('Y_m_d') . '_999999_create_cruds_table.php'), |
|
| 130 | - __DIR__ . '/../database/migrations/2021_12_17_999999_create_user_admins_table.php' => base_path('/database/migrations/' . date('Y_m_d') . '_999999_create_user_admins_table.php') |
|
| 129 | + __DIR__.'/../database/migrations/2021_07_17_999999_create_cruds_table.php' => base_path('/database/migrations/'.date('Y_m_d').'_999999_create_cruds_table.php'), |
|
| 130 | + __DIR__.'/../database/migrations/2021_12_17_999999_create_user_admins_table.php' => base_path('/database/migrations/'.date('Y_m_d').'_999999_create_user_admins_table.php') |
|
| 131 | 131 | ], 'easy-panel-migration'); |
| 132 | 132 | |
| 133 | 133 | $this->publishes([__DIR__.'/../resources/lang' => resource_path('/lang')], 'easy-panel-lang'); |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | { |
| 161 | 161 | $model = !$this->app->runningUnitTests() ? config('easy_panel.user_model') : User::class; |
| 162 | 162 | |
| 163 | - $model::resolveRelationUsing('panelAdmin', function ($userModel){ |
|
| 163 | + $model::resolveRelationUsing('panelAdmin', function($userModel) { |
|
| 164 | 164 | return $userModel->hasOne(PanelAdmin::class)->latest(); |
| 165 | 165 | }); |
| 166 | 166 | } |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | { |
| 10 | 10 | $user = $this->findUser($id); |
| 11 | 11 | |
| 12 | - if ($user->panelAdmin()->exists()){ |
|
| 12 | + if ($user->panelAdmin()->exists()) { |
|
| 13 | 13 | return [ |
| 14 | 14 | 'type' => 'error', |
| 15 | 15 | 'message' => 'User already is an admin!' |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('panel_admins', function (Blueprint $table) { |
|
| 16 | + Schema::create('panel_admins', function(Blueprint $table) { |
|
| 17 | 17 | $table->id(); |
| 18 | 18 | $table->foreignId('user_id')->constrained(); |
| 19 | 19 | $table->boolean('is_superuser'); |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | ]; |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | - private function setCRUDInstance(){ |
|
| 102 | + private function setCRUDInstance() { |
|
| 103 | 103 | $modelName = $this->getNameInput(); |
| 104 | 104 | |
| 105 | 105 | return $this->crudInstance = getCrudConfig($modelName); |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | protected function qualifyModel($model) |
| 124 | 124 | { |
| 125 | - if (class_exists($model)){ |
|
| 125 | + if (class_exists($model)) { |
|
| 126 | 126 | return $model; |
| 127 | 127 | } |
| 128 | 128 | |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | |
| 24 | 24 | public static function get($name) |
| 25 | 25 | { |
| 26 | - if (!key_exists($name, static::inputClassMap)){ |
|
| 26 | + if (!key_exists($name, static::inputClassMap)) { |
|
| 27 | 27 | throw new \Exception("The [$name] input type doesn't exist in input list!"); |
| 28 | 28 | } |
| 29 | 29 | |
@@ -14,13 +14,13 @@ |
||
| 14 | 14 | |
| 15 | 15 | [$class, $method] = $array; |
| 16 | 16 | |
| 17 | - if (! class_exists($class)){ |
|
| 17 | + if (!class_exists($class)) { |
|
| 18 | 18 | throw new Exception("Class {$class} doesn't exist."); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | $method = $method ?: 'handle'; |
| 22 | 22 | |
| 23 | - if (! method_exists($class, $method)){ |
|
| 23 | + if (!method_exists($class, $method)) { |
|
| 24 | 24 | throw new Exception("Method {$method} doesn't exist on {$class} class."); |
| 25 | 25 | } |
| 26 | 26 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | public function asImage() |
| 39 | 39 | { |
| 40 | - if($this->dataStub != 'linked-image.stub'){ |
|
| 40 | + if ($this->dataStub != 'linked-image.stub') { |
|
| 41 | 41 | $this->dataStub = 'image.stub'; |
| 42 | 42 | } |
| 43 | 43 | |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | private function getTitleStubContent() |
| 166 | 166 | { |
| 167 | - if ($this->isRelational()){ |
|
| 167 | + if ($this->isRelational()) { |
|
| 168 | 168 | return file_get_contents(__DIR__.'/stubs/titles/not-sortable.stub'); |
| 169 | 169 | } |
| 170 | 170 | |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | return \Str::contains($this->key, '.'); |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | - private function parseRelationalKey($key){ |
|
| 179 | + private function parseRelationalKey($key) { |
|
| 180 | 180 | return str_replace('.', '->', $key); |
| 181 | 181 | } |
| 182 | 182 | |