@@ -16,7 +16,7 @@ |
||
16 | 16 | <input $mode='$name' class='form-check-input' type='checkbox' id='input$name'> |
17 | 17 | <label class='form-check-label' for='input$name'>{{ __('$UName') }}</label> |
18 | 18 | </div> |
19 | - @error('$name') <div class='invalid-feedback'>{{ " . '$message' . " }}</div> @enderror |
|
19 | + @error('$name') <div class='invalid-feedback'>{{ ".'$message'." }}</div> @enderror |
|
20 | 20 | </div> |
21 | 21 | "; |
22 | 22 | } |
@@ -9,7 +9,7 @@ |
||
9 | 9 | { |
10 | 10 | $user = $this->findUser($id); |
11 | 11 | $modelInstance = app()->make(config('easy_panel.user_model')); |
12 | - if(in_array(config('easy_panel.column'), $modelInstance->getFillable())) { |
|
12 | + if (in_array(config('easy_panel.column'), $modelInstance->getFillable())) { |
|
13 | 13 | $user->update([ |
14 | 14 | config('easy_panel.column') => 1 |
15 | 15 | ]); |
@@ -40,17 +40,17 @@ |
||
40 | 40 | |
41 | 41 | protected function getStub() |
42 | 42 | { |
43 | - return __DIR__ . DIRECTORY_SEPARATOR. "..".DIRECTORY_SEPARATOR."stub".DIRECTORY_SEPARATOR."{$this->file}.stub"; |
|
43 | + return __DIR__.DIRECTORY_SEPARATOR."..".DIRECTORY_SEPARATOR."stub".DIRECTORY_SEPARATOR."{$this->file}.stub"; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | private function buildBlade() |
47 | 47 | { |
48 | - $stub = $this->files->get(__DIR__ . DIRECTORY_SEPARATOR."..".DIRECTORY_SEPARATOR."stub".DIRECTORY_SEPARATOR."blade".DIRECTORY_SEPARATOR."{$this->file}.blade.stub"); |
|
48 | + $stub = $this->files->get(__DIR__.DIRECTORY_SEPARATOR."..".DIRECTORY_SEPARATOR."stub".DIRECTORY_SEPARATOR."blade".DIRECTORY_SEPARATOR."{$this->file}.blade.stub"); |
|
49 | 49 | $newStub = $this->stubParser->parseBlade($stub); |
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 |
@@ -15,14 +15,14 @@ |
||
15 | 15 | public function handle() |
16 | 16 | { |
17 | 17 | $user = $this->argument('user'); |
18 | - try{ |
|
18 | + try { |
|
19 | 19 | $status = UserProviderFacade::makeAdmin($user); |
20 | - if($status){ |
|
20 | + if ($status) { |
|
21 | 21 | $this->info("User {$user} was converted to an admin"); |
22 | 22 | return; |
23 | 23 | } |
24 | 24 | $this->warn("It was failed, be sure your column is fillable."); |
25 | - } catch (\Exception $exception){ |
|
25 | + } catch (\Exception $exception) { |
|
26 | 26 | $this->error("User {$user} does not exist"); |
27 | 27 | } |
28 | 28 | } |
@@ -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); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | { |
17 | 17 | $names = $this->argument('name') ? [$this->argument('name')] : config('easy_panel.actions', []); |
18 | 18 | |
19 | - if(is_null($names)) { |
|
19 | + if (is_null($names)) { |
|
20 | 20 | throw new CommandNotFoundException("There is no action in config file"); |
21 | 21 | } |
22 | 22 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | $model = explode('\\', $model); |
41 | 41 | $model = strtolower(end($model)); |
42 | 42 | |
43 | - if($model != $name){ |
|
43 | + if ($model != $name) { |
|
44 | 44 | throw new CommandNotFoundException("Action key should be equal to model name, You are using {$name} as key name but your model name is {$model}"); |
45 | 45 | } |
46 | 46 | } |
@@ -15,35 +15,35 @@ discard block |
||
15 | 15 | |
16 | 16 | protected function getStub() |
17 | 17 | { |
18 | - return __DIR__ . '/../stub/crud.stub'; |
|
18 | + return __DIR__.'/../stub/crud.stub'; |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | public function handle() |
22 | 22 | { |
23 | - if(!$this->option('model')){ |
|
23 | + if (!$this->option('model')) { |
|
24 | 24 | $this->error("Model option must have a value"); |
25 | 25 | return; |
26 | 26 | } |
27 | 27 | |
28 | 28 | $name = strtolower($this->getNameInput()); |
29 | 29 | |
30 | - if($name != strtolower($this->option('model'))){ |
|
30 | + if ($name != strtolower($this->option('model'))) { |
|
31 | 31 | $this->warn("'{$name}' must be equal to model name"); |
32 | 32 | return; |
33 | 33 | } |
34 | 34 | |
35 | 35 | $path = resource_path("cruds/{$name}.php"); |
36 | 36 | |
37 | - if($this->files->exists($path) and !$this->option('force')){ |
|
37 | + if ($this->files->exists($path) and !$this->option('force')) { |
|
38 | 38 | $this->warn("'{$name}' already exists in CRUDs config"); |
39 | 39 | return; |
40 | 40 | } |
41 | 41 | |
42 | - if (! $this->files->isDirectory(dirname($path))) { |
|
42 | + if (!$this->files->isDirectory(dirname($path))) { |
|
43 | 43 | $this->files->makeDirectory(dirname($path), 0755, true); |
44 | 44 | } |
45 | 45 | |
46 | - $stub = $this->files->get(__DIR__ . '/../stub/crud.stub'); |
|
46 | + $stub = $this->files->get(__DIR__.'/../stub/crud.stub'); |
|
47 | 47 | $newStub = $this->parseStub($stub); |
48 | 48 | |
49 | 49 | $this->files->put($path, $newStub); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | { |
74 | 74 | $model = $this->qualifyModel($this->option('model')); |
75 | 75 | |
76 | - if(!class_exists($model)){ |
|
76 | + if (!class_exists($model)) { |
|
77 | 77 | $this->warn("Model option should be valid and model should be exist"); |
78 | 78 | die(); |
79 | 79 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | private function withAuth() |
85 | 85 | { |
86 | 86 | $fillableList = $this->getFillableList(); |
87 | - if(!in_array('user_id', $fillableList)){ |
|
87 | + if (!in_array('user_id', $fillableList)) { |
|
88 | 88 | return 'true'; |
89 | 89 | } |
90 | 90 | |
@@ -102,8 +102,8 @@ discard block |
||
102 | 102 | { |
103 | 103 | $fillableList = $this->getFillableList(); |
104 | 104 | $array = []; |
105 | - foreach ($fillableList as $fillable){ |
|
106 | - if(!Str::contains($fillable, 'id')){ |
|
105 | + foreach ($fillableList as $fillable) { |
|
106 | + if (!Str::contains($fillable, 'id')) { |
|
107 | 107 | $array[] = "'$fillable'"; |
108 | 108 | } |
109 | 109 | } |