@@ -61,19 +61,19 @@ discard block |
||
61 | 61 | { |
62 | 62 | $this->validate(); |
63 | 63 | |
64 | - if (!class_exists($this->model) or ! app()->make($this->model) instanceof Model){ |
|
64 | + if (!class_exists($this->model) or !app()->make($this->model) instanceof Model) { |
|
65 | 65 | $this->addError('model', __('Namespace is invalid')); |
66 | 66 | |
67 | 67 | return; |
68 | 68 | } |
69 | 69 | |
70 | - if (!preg_match('/^([a-z]|[0-9])+/', $this->route)){ |
|
70 | + if (!preg_match('/^([a-z]|[0-9])+/', $this->route)) { |
|
71 | 71 | $this->addError('route', __('Route is invalid')); |
72 | 72 | |
73 | 73 | return; |
74 | 74 | } |
75 | 75 | |
76 | - try{ |
|
76 | + try { |
|
77 | 77 | $name = $this->getModelName($this->model); |
78 | 78 | |
79 | 79 | CRUD::create([ |
@@ -88,9 +88,9 @@ discard block |
||
88 | 88 | '--force' => true |
89 | 89 | ]); |
90 | 90 | |
91 | - $this->dispatchBrowserEvent('show-message', ['type' => 'success', 'message' => __('CreatedMessage', ['name' => __('CRUD') ])]); |
|
92 | - } catch(\Exception $exception){ |
|
93 | - $this->dispatchBrowserEvent('show-message', ['type' => 'error', 'message' => __('UnknownError') ]); |
|
91 | + $this->dispatchBrowserEvent('show-message', ['type' => 'success', 'message' => __('CreatedMessage', ['name' => __('CRUD')])]); |
|
92 | + } catch (\Exception $exception) { |
|
93 | + $this->dispatchBrowserEvent('show-message', ['type' => 'error', 'message' => __('UnknownError')]); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | ->layout('admin::layouts.app'); |
105 | 105 | } |
106 | 106 | |
107 | - private function getModelName($model){ |
|
107 | + private function getModelName($model) { |
|
108 | 108 | $model = explode('\\', $model); |
109 | 109 | |
110 | 110 | return end($model); |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | |
121 | 121 | foreach ($files as $file) { |
122 | 122 | |
123 | - if ($this->fileCanNotBeListed($file->getFilename(), $query)){ |
|
123 | + if ($this->fileCanNotBeListed($file->getFilename(), $query)) { |
|
124 | 124 | continue; |
125 | 125 | } |
126 | 126 |
@@ -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 |