@@ -15,10 +15,9 @@ |
||
15 | 15 | public function handle() |
16 | 16 | { |
17 | 17 | $names = $this->argument('name') ? |
18 | - [$this->argument('name')] : |
|
19 | - CRUD::query()->where('active', true)->pluck('name')->toArray(); |
|
18 | + [$this->argument('name')] : CRUD::query()->where('active', true)->pluck('name')->toArray(); |
|
20 | 19 | |
21 | - if(is_null($names)) { |
|
20 | + if (is_null($names)) { |
|
22 | 21 | throw new CommandNotFoundException("There is no action in config file"); |
23 | 22 | } |
24 | 23 |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | $path = base_path("app/CRUD/{$name}Component.php"); |
26 | 26 | |
27 | - if($this->files->exists($path) and !$this->option('force')){ |
|
27 | + if ($this->files->exists($path) and !$this->option('force')) { |
|
28 | 28 | $this->warn("'{$name}Component.php' already exists in CRUD directory"); |
29 | 29 | return; |
30 | 30 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | { |
62 | 62 | $model = $this->qualifyModel($this->getNameInput()); |
63 | 63 | |
64 | - if(!class_exists($model)){ |
|
64 | + if (!class_exists($model)) { |
|
65 | 65 | $this->warn("Model option should be valid and model should be exist"); |
66 | 66 | die(); |
67 | 67 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | private function withAuth() |
73 | 73 | { |
74 | 74 | $fillableList = $this->getFillableList(); |
75 | - if(!in_array('user_id', $fillableList)){ |
|
75 | + if (!in_array('user_id', $fillableList)) { |
|
76 | 76 | return 'true'; |
77 | 77 | } |
78 | 78 | |
@@ -90,8 +90,8 @@ discard block |
||
90 | 90 | { |
91 | 91 | $fillableList = $this->getFillableList(); |
92 | 92 | $array = []; |
93 | - foreach ($fillableList as $fillable){ |
|
94 | - if(!Str::contains($fillable, 'id')){ |
|
93 | + foreach ($fillableList as $fillable) { |
|
94 | + if (!Str::contains($fillable, 'id')) { |
|
95 | 95 | $array[] = "'$fillable'"; |
96 | 96 | } |
97 | 97 | } |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | { |
18 | 18 | $names = (array) $this->argument('name') ?: CRUD::query()->where('active', true)->pluck('name')->toArray(); |
19 | 19 | |
20 | - if($names == null) { |
|
20 | + if ($names == null) { |
|
21 | 21 | throw new CommandNotFoundException("There is no action in database"); |
22 | 22 | } |
23 | 23 | |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | if ($this->askResult($name)) { |
31 | 31 | File::deleteDirectory(resource_path("/views/livewire/admin/$name")); |
32 | - File::deleteDirectory(app_path("/Http/Livewire/Admin/" . ucfirst($name))); |
|
32 | + File::deleteDirectory(app_path("/Http/Livewire/Admin/".ucfirst($name))); |
|
33 | 33 | File::delete(app_path("/CRUD/".ucfirst($name)."Component.php")); |
34 | 34 | $this->info("{$name} files were deleted, make sure you will delete {$name} value from actions in config"); |
35 | 35 | CRUD::query()->where('name', $name)->delete(); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | public function askResult($name) |
44 | 44 | { |
45 | - if($this->option('force')) { |
|
45 | + if ($this->option('force')) { |
|
46 | 46 | return true; |
47 | 47 | } |
48 | 48 | $result = $this->confirm("Do you really want to delete {$name} files ?", true); |
@@ -15,7 +15,7 @@ |
||
15 | 15 | { |
16 | 16 | $status = $this->confirm("Do you really want to reinstall the panel ? (All components will be deleted)", true); |
17 | 17 | |
18 | - if(!$status) { |
|
18 | + if (!$status) { |
|
19 | 19 | $this->info("The process was canceled"); |
20 | 20 | return; |
21 | 21 | } |
@@ -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 |
@@ -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 |