@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | * |
74 | 74 | * @param array $elements |
75 | 75 | */ |
76 | - public function __construct(array $elements = []) |
|
76 | + public function __construct(array $elements = [ ]) |
|
77 | 77 | { |
78 | 78 | parent::__construct($elements); |
79 | 79 | |
@@ -94,14 +94,14 @@ discard block |
||
94 | 94 | } |
95 | 95 | |
96 | 96 | $this->initialized = true; |
97 | - $this->repository = app(RepositoryInterface::class, [$this->class]); |
|
97 | + $this->repository = app(RepositoryInterface::class, [ $this->class ]); |
|
98 | 98 | |
99 | 99 | $this->setModel(app($this->class)); |
100 | 100 | |
101 | 101 | parent::initialize(); |
102 | 102 | |
103 | - $this->getElements()->each(function ($element) { |
|
104 | - if ($element instanceof Upload and ! $this->hasHtmlAttribute('enctype')) { |
|
103 | + $this->getElements()->each(function($element) { |
|
104 | + if ($element instanceof Upload and !$this->hasHtmlAttribute('enctype')) { |
|
105 | 105 | $this->setHtmlAttribute('enctype', 'multipart/form-data'); |
106 | 106 | } |
107 | 107 | }); |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | */ |
231 | 231 | public function setItems($items) |
232 | 232 | { |
233 | - if (! is_array($items)) { |
|
233 | + if (!is_array($items)) { |
|
234 | 234 | $items = func_get_args(); |
235 | 235 | } |
236 | 236 | |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | */ |
258 | 258 | public function setId($id) |
259 | 259 | { |
260 | - if (is_null($this->id) and ! is_null($id) and ($model = $this->getRepository()->find($id))) { |
|
260 | + if (is_null($this->id) and !is_null($id) and ($model = $this->getRepository()->find($id))) { |
|
261 | 261 | $this->id = $id; |
262 | 262 | $this->setModel($model); |
263 | 263 | } |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | $model = $this->getModel(); |
324 | 324 | |
325 | 325 | foreach ($model->getRelations() as $name => $relation) { |
326 | - if ($model->{$name}() instanceof BelongsTo && ! is_null($relation)) { |
|
326 | + if ($model->{$name}() instanceof BelongsTo && !is_null($relation)) { |
|
327 | 327 | $relation->save(); |
328 | 328 | $model->{$name}()->associate($relation); |
329 | 329 | } |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | $model = $this->getModel(); |
336 | 336 | |
337 | 337 | foreach ($model->getRelations() as $name => $relation) { |
338 | - if ($model->{$name}() instanceof HasOneOrMany && ! is_null($relation)) { |
|
338 | + if ($model->{$name}() instanceof HasOneOrMany && !is_null($relation)) { |
|
339 | 339 | if (is_array($relation) || $relation instanceof \Traversable) { |
340 | 340 | $model->{$name}()->saveMany($relation); |
341 | 341 | } else { |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | * @deprecated 4.5.0 |
214 | 214 | * @see getElements() |
215 | 215 | * |
216 | - * @return Collection[] |
|
216 | + * @return FormElementsCollection |
|
217 | 217 | */ |
218 | 218 | public function getItems() |
219 | 219 | { |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | * |
302 | 302 | * @param ModelConfigurationInterface $modelConfiguration |
303 | 303 | * |
304 | - * @return bool |
|
304 | + * @return null|boolean |
|
305 | 305 | */ |
306 | 306 | public function saveForm(ModelConfigurationInterface $modelConfiguration) |
307 | 307 | { |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * |
22 | 22 | * @param array $elements |
23 | 23 | */ |
24 | - public function __construct(array $elements = []) |
|
24 | + public function __construct(array $elements = [ ]) |
|
25 | 25 | { |
26 | 26 | $this->elements = new Collection(); |
27 | 27 | parent::__construct($elements); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $element = new Column($element); |
68 | 68 | } |
69 | 69 | |
70 | - if (! ($element instanceof ColumnInterface)) { |
|
70 | + if (!($element instanceof ColumnInterface)) { |
|
71 | 71 | throw new \Exception('Column should be instance of ColumnInterface'); |
72 | 72 | } |
73 | 73 | |
@@ -82,16 +82,16 @@ discard block |
||
82 | 82 | { |
83 | 83 | $this->setHtmlAttribute('class', 'row'); |
84 | 84 | |
85 | - $count = $this->getElements()->filter(function (ColumnInterface $column) { |
|
85 | + $count = $this->getElements()->filter(function(ColumnInterface $column) { |
|
86 | 86 | return $column->getWidth() === 0; |
87 | 87 | })->count(); |
88 | 88 | |
89 | - $width = $this->maxWidth - $this->getElements()->sum(function (ColumnInterface $column) { |
|
89 | + $width = $this->maxWidth - $this->getElements()->sum(function(ColumnInterface $column) { |
|
90 | 90 | return $column->getWidth(); |
91 | 91 | }); |
92 | 92 | |
93 | - $this->getElements()->each(function (ColumnInterface $column) use ($width, $count) { |
|
94 | - if (! $column->getWidth()) { |
|
93 | + $this->getElements()->each(function(ColumnInterface $column) use ($width, $count) { |
|
94 | + if (!$column->getWidth()) { |
|
95 | 95 | $column->setWidth(floor($width / $count)); |
96 | 96 | } |
97 | 97 | }); |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | */ |
132 | 132 | public function setSize($size) |
133 | 133 | { |
134 | - $this->getColumns()->each(function (ColumnInterface $column) use ($size) { |
|
134 | + $this->getColumns()->each(function(ColumnInterface $column) use ($size) { |
|
135 | 135 | $column->setSize($size); |
136 | 136 | }); |
137 | 137 | } |
@@ -14,7 +14,7 @@ |
||
14 | 14 | * |
15 | 15 | * @param array $elements |
16 | 16 | */ |
17 | - public function __construct(array $elements = []) |
|
17 | + public function __construct(array $elements = [ ]) |
|
18 | 18 | { |
19 | 19 | parent::__construct(); |
20 | 20 |
@@ -87,6 +87,6 @@ |
||
87 | 87 | | |
88 | 88 | */ |
89 | 89 | |
90 | - 'attributes' => [], |
|
90 | + 'attributes' => [ ], |
|
91 | 91 | |
92 | 92 | ]; |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (! function_exists('resources_url')) { |
|
3 | +if (!function_exists('resources_url')) { |
|
4 | 4 | function resources_url($path) |
5 | 5 | { |
6 | 6 | return '/packages/sleepingowl/default/'.$path; |
@@ -14,11 +14,11 @@ discard block |
||
14 | 14 | */ |
15 | 15 | |
16 | 16 | WysiwygManager::register('ckeditor') |
17 | - ->js(null, '//cdn.ckeditor.com/4.5.7/standard/ckeditor.js', ['jquery']); |
|
17 | + ->js(null, '//cdn.ckeditor.com/4.5.7/standard/ckeditor.js', [ 'jquery' ]); |
|
18 | 18 | |
19 | 19 | WysiwygManager::register('tinymce') |
20 | - ->js(null, '//cdn.tinymce.com/4/tinymce.min.js', ['jquery']); |
|
20 | + ->js(null, '//cdn.tinymce.com/4/tinymce.min.js', [ 'jquery' ]); |
|
21 | 21 | |
22 | 22 | WysiwygManager::register('simplemde', new \SleepingOwl\Admin\Wysiwyg\MarkdownFilter()) |
23 | - ->js(null, '//cdn.jsdelivr.net/simplemde/latest/simplemde.min.js', ['jquery']) |
|
23 | + ->js(null, '//cdn.jsdelivr.net/simplemde/latest/simplemde.min.js', [ 'jquery' ]) |
|
24 | 24 | ->css(null, '//cdn.jsdelivr.net/simplemde/latest/simplemde.min.css'); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | | |
46 | 46 | */ |
47 | 47 | |
48 | - 'middleware' => ['web'], |
|
48 | + 'middleware' => [ 'web' ], |
|
49 | 49 | |
50 | 50 | /* |
51 | 51 | |-------------------------------------------------------------------------- |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | * See https://github.com/NextStepWebs/simplemde-markdown-editor |
134 | 134 | */ |
135 | 135 | 'simplemde' => [ |
136 | - 'hideIcons' => ['side-by-side', 'fullscreen'], |
|
136 | + 'hideIcons' => [ 'side-by-side', 'fullscreen' ], |
|
137 | 137 | ], |
138 | 138 | ], |
139 | 139 | |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | | Select default settings for datatable |
146 | 146 | | |
147 | 147 | */ |
148 | - 'datatables' => [], |
|
148 | + 'datatables' => [ ], |
|
149 | 149 | |
150 | 150 | /* |
151 | 151 | |-------------------------------------------------------------------------- |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | { |
10 | 10 | public function __construct() |
11 | 11 | { |
12 | - Meta::addJs('admin-default', resources_url('js/admin-app.js'), ['admin-scripts']) |
|
12 | + Meta::addJs('admin-default', resources_url('js/admin-app.js'), [ 'admin-scripts' ]) |
|
13 | 13 | ->addJs('admin-scripts', route('admin.scripts')) |
14 | 14 | ->addCss('admin-default', resources_url('css/admin-app.css')); |
15 | 15 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * |
55 | 55 | * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
56 | 56 | */ |
57 | - public function view($view, $data = [], $mergeData = []) |
|
57 | + public function view($view, $data = [ ], $mergeData = [ ]) |
|
58 | 58 | { |
59 | 59 | if ($view instanceof \Illuminate\View\View) { |
60 | 60 | return $view->with($data); |
@@ -26,16 +26,16 @@ discard block |
||
26 | 26 | { |
27 | 27 | $routeName = 'admin.form.element.'.static::$route; |
28 | 28 | |
29 | - if (! $router->has($routeName)) { |
|
30 | - $router->post('{adminModel}/'.static::$route.'/{field}/{id?}', ['as' => $routeName, function ( |
|
29 | + if (!$router->has($routeName)) { |
|
30 | + $router->post('{adminModel}/'.static::$route.'/{field}/{id?}', [ 'as' => $routeName, function( |
|
31 | 31 | Request $request, |
32 | 32 | ModelConfigurationInterface $model, |
33 | 33 | $field, |
34 | 34 | $id = null |
35 | 35 | ) { |
36 | - if (! is_null($id)) { |
|
36 | + if (!is_null($id)) { |
|
37 | 37 | $item = $model->getRepository()->find($id); |
38 | - if (is_null($item) || ! $model->isEditable($item)) { |
|
38 | + if (is_null($item) || !$model->isEditable($item)) { |
|
39 | 39 | return new JsonResponse([ |
40 | 40 | 'message' => trans('lang.message.access_denied'), |
41 | 41 | ], 403); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | $form = $model->fireEdit($id); |
45 | 45 | } else { |
46 | - if (! $model->isCreatable()) { |
|
46 | + if (!$model->isCreatable()) { |
|
47 | 47 | return new JsonResponse([ |
48 | 48 | 'message' => trans('lang.message.access_denied'), |
49 | 49 | ], 403); |
@@ -52,11 +52,11 @@ discard block |
||
52 | 52 | $form = $model->fireCreate(); |
53 | 53 | } |
54 | 54 | |
55 | - $messages = []; |
|
56 | - $labels = []; |
|
55 | + $messages = [ ]; |
|
56 | + $labels = [ ]; |
|
57 | 57 | $rules = static::defaultUploadValidationRules(); |
58 | 58 | |
59 | - if (! is_null($element = $form->getElement($field))) { |
|
59 | + if (!is_null($element = $form->getElement($field))) { |
|
60 | 60 | $rules = $element->getUploadValidationRules(); |
61 | 61 | $messages = $element->getUploadValidationMessages(); |
62 | 62 | $labels = $element->getUploadValidationLabels(); |
@@ -76,14 +76,14 @@ discard block |
||
76 | 76 | $file = $request->file('file'); |
77 | 77 | |
78 | 78 | /** @var File $element */ |
79 | - if (! is_null($element = $form->getElement($field))) { |
|
79 | + if (!is_null($element = $form->getElement($field))) { |
|
80 | 80 | $filename = $element->getUploadFileName($file); |
81 | 81 | $path = $element->getUploadPath($file); |
82 | 82 | $settings = $element->getUploadSettings(); |
83 | 83 | } else { |
84 | 84 | $filename = static::defaultUploadFilename($file); |
85 | 85 | $path = static::defaultUploadPath($file); |
86 | - $settings = []; |
|
86 | + $settings = [ ]; |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | static::saveFile($file, public_path($path), $filename, $settings); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | 'url' => asset($value), |
95 | 95 | 'value' => $value, |
96 | 96 | ]); |
97 | - }]); |
|
97 | + } ]); |
|
98 | 98 | } |
99 | 99 | } |
100 | 100 | |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | protected static function defaultUploadValidationRules() |
143 | 143 | { |
144 | 144 | return [ |
145 | - 'file' => ['required', 'file'], |
|
145 | + 'file' => [ 'required', 'file' ], |
|
146 | 146 | ]; |
147 | 147 | } |
148 | 148 | |
@@ -159,21 +159,21 @@ discard block |
||
159 | 159 | /** |
160 | 160 | * @var array |
161 | 161 | */ |
162 | - protected $uploadSettings = []; |
|
162 | + protected $uploadSettings = [ ]; |
|
163 | 163 | |
164 | 164 | /** |
165 | 165 | * @var array |
166 | 166 | */ |
167 | - protected $uploadValidationRules = ['required', 'file']; |
|
167 | + protected $uploadValidationRules = [ 'required', 'file' ]; |
|
168 | 168 | |
169 | 169 | /** |
170 | 170 | * @return array |
171 | 171 | */ |
172 | 172 | public function getUploadValidationMessages() |
173 | 173 | { |
174 | - $messages = []; |
|
174 | + $messages = [ ]; |
|
175 | 175 | foreach ($this->validationMessages as $rule => $message) { |
176 | - $messages["file.{$rule}"] = $message; |
|
176 | + $messages[ "file.{$rule}" ] = $message; |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | return $messages; |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | */ |
185 | 185 | public function getUploadValidationLabels() |
186 | 186 | { |
187 | - return ['file' => $this->getLabel()]; |
|
187 | + return [ 'file' => $this->getLabel() ]; |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | /** |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | */ |
193 | 193 | public function getUploadValidationRules() |
194 | 194 | { |
195 | - return ['file' => array_unique($this->uploadValidationRules)]; |
|
195 | + return [ 'file' => array_unique($this->uploadValidationRules) ]; |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | /** |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | */ |
203 | 203 | public function getUploadPath(UploadedFile $file) |
204 | 204 | { |
205 | - if (! is_callable($this->uploadPath)) { |
|
205 | + if (!is_callable($this->uploadPath)) { |
|
206 | 206 | return static::defaultUploadPath($file); |
207 | 207 | } |
208 | 208 | |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | */ |
229 | 229 | public function getUploadFileName(UploadedFile $file) |
230 | 230 | { |
231 | - if (! is_callable($this->uploadFileName)) { |
|
231 | + if (!is_callable($this->uploadFileName)) { |
|
232 | 232 | return static::defaultUploadFilename($file); |
233 | 233 | } |
234 | 234 | |
@@ -279,11 +279,11 @@ discard block |
||
279 | 279 | */ |
280 | 280 | public function addValidationRule($rule, $message = null) |
281 | 281 | { |
282 | - $uploadRules = ['file', 'image', 'mime', 'size', 'dimensions', 'max', 'min', 'between']; |
|
282 | + $uploadRules = [ 'file', 'image', 'mime', 'size', 'dimensions', 'max', 'min', 'between' ]; |
|
283 | 283 | |
284 | 284 | foreach ($uploadRules as $uploadRule) { |
285 | 285 | if (strpos($rule, $uploadRule) !== false) { |
286 | - $this->uploadValidationRules[] = $rule; |
|
286 | + $this->uploadValidationRules[ ] = $rule; |
|
287 | 287 | |
288 | 288 | if (is_null($message)) { |
289 | 289 | return $this; |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | * |
247 | 247 | * @param Request $request |
248 | 248 | * |
249 | - * @return bool |
|
249 | + * @return boolean|null |
|
250 | 250 | */ |
251 | 251 | public function inlineEdit(ModelConfigurationInterface $model, Request $request) |
252 | 252 | { |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | } |
346 | 346 | |
347 | 347 | /** |
348 | - * @param ModelConfigurationInterface|ModelConfiguration $model |
|
348 | + * @param ModelConfigurationInterface $model |
|
349 | 349 | * @param Request $request |
350 | 350 | * @param int $id |
351 | 351 | * |
@@ -39,35 +39,35 @@ discard block |
||
39 | 39 | public function __construct(Request $request, \Illuminate\Contracts\Foundation\Application $application) |
40 | 40 | { |
41 | 41 | $this->application = $application; |
42 | - $this->navigation = $application['sleeping_owl.navigation']; |
|
42 | + $this->navigation = $application[ 'sleeping_owl.navigation' ]; |
|
43 | 43 | $this->navigation->setCurrentUrl($request->url()); |
44 | 44 | |
45 | - if (! Breadcrumbs::exists('home')) { |
|
46 | - Breadcrumbs::register('home', function ($breadcrumbs) { |
|
45 | + if (!Breadcrumbs::exists('home')) { |
|
46 | + Breadcrumbs::register('home', function($breadcrumbs) { |
|
47 | 47 | $breadcrumbs->push(trans('sleeping_owl::lang.dashboard'), route('admin.dashboard')); |
48 | 48 | }); |
49 | 49 | } |
50 | 50 | |
51 | - $breadcrumbs = []; |
|
51 | + $breadcrumbs = [ ]; |
|
52 | 52 | |
53 | 53 | if ($currentPage = $this->navigation->getCurrentPage()) { |
54 | 54 | foreach ($currentPage->getPathArray() as $page) { |
55 | - $breadcrumbs[] = [ |
|
56 | - 'id' => $page['id'], |
|
57 | - 'title' => $page['title'], |
|
58 | - 'url' => $page['url'], |
|
55 | + $breadcrumbs[ ] = [ |
|
56 | + 'id' => $page[ 'id' ], |
|
57 | + 'title' => $page[ 'title' ], |
|
58 | + 'url' => $page[ 'url' ], |
|
59 | 59 | 'parent' => $this->parentBreadcrumb, |
60 | 60 | ]; |
61 | 61 | |
62 | - $this->parentBreadcrumb = $page['id']; |
|
62 | + $this->parentBreadcrumb = $page[ 'id' ]; |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | |
66 | 66 | foreach ($breadcrumbs as $breadcrumb) { |
67 | - if (! Breadcrumbs::exists($breadcrumb['id'])) { |
|
68 | - Breadcrumbs::register($breadcrumb['id'], function ($breadcrumbs) use ($breadcrumb) { |
|
69 | - $breadcrumbs->parent($breadcrumb['parent']); |
|
70 | - $breadcrumbs->push($breadcrumb['title'], $breadcrumb['url']); |
|
67 | + if (!Breadcrumbs::exists($breadcrumb[ 'id' ])) { |
|
68 | + Breadcrumbs::register($breadcrumb[ 'id' ], function($breadcrumbs) use ($breadcrumb) { |
|
69 | + $breadcrumbs->parent($breadcrumb[ 'parent' ]); |
|
70 | + $breadcrumbs->push($breadcrumb[ 'title' ], $breadcrumb[ 'url' ]); |
|
71 | 71 | }); |
72 | 72 | } |
73 | 73 | } |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | */ |
108 | 108 | public function getDisplay(ModelConfigurationInterface $model) |
109 | 109 | { |
110 | - if (! $model->isDisplayable()) { |
|
110 | + if (!$model->isDisplayable()) { |
|
111 | 111 | abort(404); |
112 | 112 | } |
113 | 113 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | */ |
122 | 122 | public function getCreate(ModelConfigurationInterface $model) |
123 | 123 | { |
124 | - if (! $model->isCreatable()) { |
|
124 | + if (!$model->isCreatable()) { |
|
125 | 125 | abort(404); |
126 | 126 | } |
127 | 127 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | */ |
140 | 140 | public function postStore(ModelConfigurationInterface $model, Request $request) |
141 | 141 | { |
142 | - if (! $model->isCreatable()) { |
|
142 | + if (!$model->isCreatable()) { |
|
143 | 143 | abort(404); |
144 | 144 | } |
145 | 145 | |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | $redirectPolicy = $model->getRedirect(); |
174 | 174 | |
175 | 175 | /* Make redirect when use in model config && Fix editable redirect */ |
176 | - if ($redirectPolicy->get('create') == 'display' || ! $model->isEditable($newModel)) { |
|
176 | + if ($redirectPolicy->get('create') == 'display' || !$model->isEditable($newModel)) { |
|
177 | 177 | $redirectUrl = $model->getDisplayUrl(); |
178 | 178 | } |
179 | 179 | |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | { |
209 | 209 | $item = $model->getRepository()->find($id); |
210 | 210 | |
211 | - if (is_null($item) || ! $model->isEditable($item)) { |
|
211 | + if (is_null($item) || !$model->isEditable($item)) { |
|
212 | 212 | abort(404); |
213 | 213 | } |
214 | 214 | |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | $editForm = $model->fireEdit($id); |
231 | 231 | $item = $editForm->getModel(); |
232 | 232 | |
233 | - if (is_null($item) || ! $model->isEditable($item)) { |
|
233 | + if (is_null($item) || !$model->isEditable($item)) { |
|
234 | 234 | abort(404); |
235 | 235 | } |
236 | 236 | |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | $display = $model->fireDisplay(); |
300 | 300 | |
301 | 301 | /** @var ColumnEditableInterface|null $column */ |
302 | - $column = $display->getColumns()->all()->filter(function ($column) use ($field) { |
|
302 | + $column = $display->getColumns()->all()->filter(function($column) use ($field) { |
|
303 | 303 | return ($column instanceof ColumnEditableInterface) and $field == $column->getName(); |
304 | 304 | })->first(); |
305 | 305 | |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | $repository = $model->getRepository(); |
311 | 311 | $item = $repository->find($id); |
312 | 312 | |
313 | - if (is_null($item) || ! $model->isEditable($item)) { |
|
313 | + if (is_null($item) || !$model->isEditable($item)) { |
|
314 | 314 | abort(404); |
315 | 315 | } |
316 | 316 | |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | { |
336 | 336 | $item = $model->getRepository()->find($id); |
337 | 337 | |
338 | - if (is_null($item) || ! $model->isDeletable($item)) { |
|
338 | + if (is_null($item) || !$model->isDeletable($item)) { |
|
339 | 339 | abort(404); |
340 | 340 | } |
341 | 341 | |
@@ -362,13 +362,13 @@ discard block |
||
362 | 362 | */ |
363 | 363 | public function deleteDestroy(ModelConfigurationInterface $model, Request $request, $id) |
364 | 364 | { |
365 | - if (! $model->isRestorableModel()) { |
|
365 | + if (!$model->isRestorableModel()) { |
|
366 | 366 | abort(404); |
367 | 367 | } |
368 | 368 | |
369 | 369 | $item = $model->getRepository()->findOnlyTrashed($id); |
370 | 370 | |
371 | - if (is_null($item) || ! $model->isRestorable($item)) { |
|
371 | + if (is_null($item) || !$model->isRestorable($item)) { |
|
372 | 372 | abort(404); |
373 | 373 | } |
374 | 374 | |
@@ -395,13 +395,13 @@ discard block |
||
395 | 395 | */ |
396 | 396 | public function postRestore(ModelConfigurationInterface $model, Request $request, $id) |
397 | 397 | { |
398 | - if (! $model->isRestorableModel()) { |
|
398 | + if (!$model->isRestorableModel()) { |
|
399 | 399 | abort(404); |
400 | 400 | } |
401 | 401 | |
402 | 402 | $item = $model->getRepository()->findOnlyTrashed($id); |
403 | 403 | |
404 | - if (is_null($item) || ! $model->isRestorable($item)) { |
|
404 | + if (is_null($item) || !$model->isRestorable($item)) { |
|
405 | 405 | abort(404); |
406 | 406 | } |
407 | 407 | |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | { |
468 | 468 | $lang = trans('sleeping_owl::lang'); |
469 | 469 | if ($lang == 'sleeping_owl::lang') { |
470 | - $lang = trans('sleeping_owl::lang', [], 'messages', 'en'); |
|
470 | + $lang = trans('sleeping_owl::lang', [ ], 'messages', 'en'); |
|
471 | 471 | } |
472 | 472 | |
473 | 473 | $data = [ |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | { |
511 | 511 | if (($backUrl = $request->input('_redirectBack')) == \URL::previous()) { |
512 | 512 | $backUrl = null; |
513 | - $request->merge(['_redirectBack' => $backUrl]); |
|
513 | + $request->merge([ '_redirectBack' => $backUrl ]); |
|
514 | 514 | } |
515 | 515 | |
516 | 516 | return $backUrl; |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | */ |
528 | 528 | protected function registerBreadcrumb($title, $parent) |
529 | 529 | { |
530 | - Breadcrumbs::register('render', function ($breadcrumbs) use ($title, $parent) { |
|
530 | + Breadcrumbs::register('render', function($breadcrumbs) use ($title, $parent) { |
|
531 | 531 | $breadcrumbs->parent($parent); |
532 | 532 | $breadcrumbs->push($title); |
533 | 533 | }); |