@@ -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 |
@@ -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 |
@@ -15,11 +15,11 @@ |
||
15 | 15 | |
16 | 16 | auth()->shouldUse($defaultGuard); |
17 | 17 | |
18 | - if(auth()->guest()){ |
|
18 | + if (auth()->guest()) { |
|
19 | 19 | return redirect($redirectPath); |
20 | 20 | } |
21 | 21 | |
22 | - if(!AuthFacade::check(auth()->user()->id)){ |
|
22 | + if (!AuthFacade::check(auth()->user()->id)) { |
|
23 | 23 | return redirect($redirectPath); |
24 | 24 | } |
25 | 25 |