@@ -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 | CRUD::create([ |
79 | 79 | 'model' => trim($this->model, '\\'), |
@@ -87,9 +87,9 @@ discard block |
||
87 | 87 | '--force' => true |
88 | 88 | ]); |
89 | 89 | |
90 | - $this->dispatchBrowserEvent('show-message', ['type' => 'success', 'message' => __('CreatedMessage', ['name' => __('CRUD') ])]); |
|
91 | - } catch(\Exception $exception){ |
|
92 | - $this->dispatchBrowserEvent('show-message', ['type' => 'error', 'message' => __('UnknownError') ]); |
|
90 | + $this->dispatchBrowserEvent('show-message', ['type' => 'success', 'message' => __('CreatedMessage', ['name' => __('CRUD')])]); |
|
91 | + } catch (\Exception $exception) { |
|
92 | + $this->dispatchBrowserEvent('show-message', ['type' => 'error', 'message' => __('UnknownError')]); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | ->layout('admin::layouts.app'); |
104 | 104 | } |
105 | 105 | |
106 | - private function getModelName($model){ |
|
106 | + private function getModelName($model) { |
|
107 | 107 | $model = explode('\\', $model); |
108 | 108 | |
109 | 109 | return end($model); |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | |
120 | 120 | foreach ($files as $file) { |
121 | 121 | |
122 | - if ($this->fileCanNotBeListed($file->getFilename(), $query)){ |
|
122 | + if ($this->fileCanNotBeListed($file->getFilename(), $query)) { |
|
123 | 123 | continue; |
124 | 124 | } |
125 | 125 |