@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | { |
333 | 333 | $translation = $this->model->getTranslationModel(); |
334 | 334 | |
335 | - return $this->query->whereHas('translations', function ($query) use ($translation, $name, $type, $value) { |
|
335 | + return $this->query->whereHas('translations', function($query) use ($translation, $name, $type, $value) { |
|
336 | 336 | return $query = $this->applyQueryElementByType($query, $translation->getTable(), $name, $type, $value); |
337 | 337 | }); |
338 | 338 | } |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | |
353 | 353 | return $this->query->whereHas( |
354 | 354 | $input->getRelation(), |
355 | - function ($query) use ($relatedTable, $name, $type, $value) { |
|
355 | + function($query) use ($relatedTable, $name, $type, $value) { |
|
356 | 356 | $query = $this->applyQueryElementByType($query, $relatedTable, $name, $type, $value); |
357 | 357 | |
358 | 358 | return $query; |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $id = (array) $id; |
107 | 107 | } |
108 | 108 | |
109 | - $items = $this->filter(function ($element) use ($id) { |
|
109 | + $items = $this->filter(function($element) use ($id) { |
|
110 | 110 | return !in_array($element->id(), $id, true); |
111 | 111 | })->all(); |
112 | 112 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | */ |
125 | 125 | public function visibleOnPage(string $page) |
126 | 126 | { |
127 | - return $this->filter(function ($item) use ($page) { |
|
127 | + return $this->filter(function($item) use ($page) { |
|
128 | 128 | return ($item instanceof Group) || $item->isVisibleOnPage($page); |
129 | 129 | }); |
130 | 130 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | if (str_contains($id, ',')) { |
143 | 143 | collect(explode(',', $id)) |
144 | 144 | ->map('trim') |
145 | - ->each(function ($element) use ($callback) { |
|
145 | + ->each(function($element) use ($callback) { |
|
146 | 146 | $this->update($element, $callback); |
147 | 147 | }); |
148 | 148 | |
@@ -282,9 +282,9 @@ discard block |
||
282 | 282 | { |
283 | 283 | $group = new Group($groupId); |
284 | 284 | |
285 | - $this->filter(function ($element) use ($elements) { |
|
285 | + $this->filter(function($element) use ($elements) { |
|
286 | 286 | return in_array($element->id(), $elements, true); |
287 | - })->each(function ($element) use ($group) { |
|
287 | + })->each(function($element) use ($group) { |
|
288 | 288 | $group->push($element); |
289 | 289 | $this->items = $this->without($element->id())->all(); |
290 | 290 | }); |
@@ -307,9 +307,9 @@ discard block |
||
307 | 307 | */ |
308 | 308 | public function build($decorator) |
309 | 309 | { |
310 | - return $this->map(function ($element) use ($decorator) { |
|
310 | + return $this->map(function($element) use ($decorator) { |
|
311 | 311 | if ($element instanceof Group) { |
312 | - $element->map(function ($e) use ($decorator) { |
|
312 | + $element->map(function($e) use ($decorator) { |
|
313 | 313 | return $decorator->make($e); |
314 | 314 | }); |
315 | 315 | |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | */ |
330 | 330 | public function find(string $id) |
331 | 331 | { |
332 | - $element = $this->first(function ($element) use ($id) { |
|
332 | + $element = $this->first(function($element) use ($id) { |
|
333 | 333 | return $element->id() === $id; |
334 | 334 | }); |
335 | 335 |
@@ -102,7 +102,7 @@ |
||
102 | 102 | |
103 | 103 | protected function publishDependencies() |
104 | 104 | { |
105 | - $this->dependencies()->each(function ($provider) { |
|
105 | + $this->dependencies()->each(function($provider) { |
|
106 | 106 | Artisan::call('vendor:publish', [ |
107 | 107 | '--provider' => $provider, |
108 | 108 | ]); |
@@ -46,14 +46,14 @@ discard block |
||
46 | 46 | call_user_func_array([$this, $method], []); |
47 | 47 | } |
48 | 48 | |
49 | - $this->app->bind(Module::class, function ($app) { |
|
49 | + $this->app->bind(Module::class, function($app) { |
|
50 | 50 | return $app['scaffold.module']; |
51 | 51 | }); |
52 | 52 | } |
53 | 53 | |
54 | 54 | protected function registerAdminConfig() |
55 | 55 | { |
56 | - $this->app->singleton('scaffold.config', function ($app) { |
|
56 | + $this->app->singleton('scaffold.config', function($app) { |
|
57 | 57 | $config = $app['config']['administrator']; |
58 | 58 | |
59 | 59 | return new Config((array) $config); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | // 2. they are protected from saving process |
70 | 70 | // Making locale(s) Readonly remains for Dev's side: the recommended way - use a custom Middleware. |
71 | 71 | // ex.: app('scaffold.translations')->setReadonly([1, 2, 3]) |
72 | - $this->app->singleton('scaffold.translations', function ($app) { |
|
72 | + $this->app->singleton('scaffold.translations', function($app) { |
|
73 | 73 | $service = new class() { |
74 | 74 | protected $readonly = []; |
75 | 75 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | protected function registerAdminDashboard() |
117 | 117 | { |
118 | - $this->app->singleton('scaffold.dashboard', function () { |
|
118 | + $this->app->singleton('scaffold.dashboard', function() { |
|
119 | 119 | if ($factory = config('administrator.dashboard')) { |
120 | 120 | return app($factory)->make(); |
121 | 121 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | |
125 | 125 | protected function registerAdminResource() |
126 | 126 | { |
127 | - $this->app->singleton('scaffold.module', function ($app) { |
|
127 | + $this->app->singleton('scaffold.module', function($app) { |
|
128 | 128 | if (in_array($app['router']->currentRouteName(), ['scaffold.settings.edit', 'scaffold.settings.update'], true)) { |
129 | 129 | return $app['scaffold.module.settings']; |
130 | 130 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | |
141 | 141 | protected function registerAdminModel() |
142 | 142 | { |
143 | - $this->app->singleton('scaffold.model', function ($app) { |
|
143 | + $this->app->singleton('scaffold.model', function($app) { |
|
144 | 144 | if (($finder = app('scaffold.finder')) |
145 | 145 | && ($id = $app['router']->current()->parameter('id')) |
146 | 146 | ) { |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | |
152 | 152 | protected function registerAdminSchema() |
153 | 153 | { |
154 | - $this->app->singleton('scaffold.schema', function ($app) { |
|
154 | + $this->app->singleton('scaffold.schema', function($app) { |
|
155 | 155 | if ($schema = $app['db']->connection()->getDoctrineSchemaManager()) { |
156 | 156 | // fix dbal missing types |
157 | 157 | $platform = $schema->getDatabasePlatform(); |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | |
166 | 166 | protected function registerAdminSortable() |
167 | 167 | { |
168 | - $this->app->singleton('scaffold.sortable', function ($app) { |
|
168 | + $this->app->singleton('scaffold.sortable', function($app) { |
|
169 | 169 | if ($module = $app['scaffold.module']) { |
170 | 170 | return new Sorter( |
171 | 171 | $module instanceof Sortable ? $module->sortable() : [], |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | |
178 | 178 | protected function registerAdminColumns() |
179 | 179 | { |
180 | - $this->app->singleton('scaffold.columns', function ($app) { |
|
180 | + $this->app->singleton('scaffold.columns', function($app) { |
|
181 | 181 | if ($module = $app['scaffold.module']) { |
182 | 182 | return $module->columns(); |
183 | 183 | } |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | |
187 | 187 | protected function registerAdminActions() |
188 | 188 | { |
189 | - $this->app->singleton('scaffold.actions', function ($app) { |
|
189 | + $this->app->singleton('scaffold.actions', function($app) { |
|
190 | 190 | if ($module = $app['scaffold.module']) { |
191 | 191 | return $module->actionsManager(); |
192 | 192 | } |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | |
196 | 196 | protected function registerAdminTemplate() |
197 | 197 | { |
198 | - $this->app->singleton('scaffold.template', function ($app) { |
|
198 | + $this->app->singleton('scaffold.template', function($app) { |
|
199 | 199 | // check for resource template |
200 | 200 | $handler = ($module = $app['scaffold.module']) ? $module->template() : Template::class; |
201 | 201 | $handler = new $handler(); |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | |
211 | 211 | protected function registerAdminForm() |
212 | 212 | { |
213 | - $this->app->singleton('scaffold.form', function ($app) { |
|
213 | + $this->app->singleton('scaffold.form', function($app) { |
|
214 | 214 | if ($module = $app['scaffold.module']) { |
215 | 215 | return $module->form(); |
216 | 216 | } |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | |
220 | 220 | protected function registerAdminMagnet() |
221 | 221 | { |
222 | - $this->app->singleton('scaffold.magnet', function ($app) { |
|
222 | + $this->app->singleton('scaffold.magnet', function($app) { |
|
223 | 223 | if ($module = $app['scaffold.module']) { |
224 | 224 | return new MagnetParams($app['request'], $module->magnetParams()); |
225 | 225 | } |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | |
229 | 229 | protected function registerAdminFilter() |
230 | 230 | { |
231 | - $this->app->singleton('scaffold.filter', function ($app) { |
|
231 | + $this->app->singleton('scaffold.filter', function($app) { |
|
232 | 232 | if ($module = $app['scaffold.module']) { |
233 | 233 | $filters = $module instanceof Filtrable ? $module->filters() : null; |
234 | 234 | $scopes = $module instanceof Filtrable ? $module->scopes() : null; |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | |
241 | 241 | protected function registerAdminFinder() |
242 | 242 | { |
243 | - $this->app->singleton('scaffold.finder', function ($app) { |
|
243 | + $this->app->singleton('scaffold.finder', function($app) { |
|
244 | 244 | if ($module = $app['scaffold.module']) { |
245 | 245 | // in order to register sortable columns, |
246 | 246 | // resolve columns service before finder. |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | |
261 | 261 | protected function registerAdminBreadcrumbs() |
262 | 262 | { |
263 | - $this->app->singleton('scaffold.breadcrumbs', function ($app) { |
|
263 | + $this->app->singleton('scaffold.breadcrumbs', function($app) { |
|
264 | 264 | if ($module = $app['scaffold.module']) { |
265 | 265 | $provider = $module->breadcrumbs(); |
266 | 266 | |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | |
272 | 272 | protected function registerAdminNavigation() |
273 | 273 | { |
274 | - $this->app->singleton('scaffold.navigation', function ($app) { |
|
274 | + $this->app->singleton('scaffold.navigation', function($app) { |
|
275 | 275 | if ($factory = $app['scaffold.config']->get('menu')) { |
276 | 276 | return app($factory)->make(); |
277 | 277 | } |
@@ -51,91 +51,91 @@ |
||
51 | 51 | |
52 | 52 | protected function registerAdminPublishCommand() |
53 | 53 | { |
54 | - $this->app->singleton('command.administrator.publish', function () { |
|
54 | + $this->app->singleton('command.administrator.publish', function() { |
|
55 | 55 | return new PublishCommand(); |
56 | 56 | }); |
57 | 57 | } |
58 | 58 | |
59 | 59 | protected function registerAdminCreateCommand() |
60 | 60 | { |
61 | - $this->app->singleton('command.administrator.create', function ($app) { |
|
61 | + $this->app->singleton('command.administrator.create', function($app) { |
|
62 | 62 | return new AdministratorCreateCommand($app['hash']); |
63 | 63 | }); |
64 | 64 | } |
65 | 65 | |
66 | 66 | protected function registerAdminModuleCommand() |
67 | 67 | { |
68 | - $this->app->singleton('command.administrator.module', function ($app) { |
|
68 | + $this->app->singleton('command.administrator.module', function($app) { |
|
69 | 69 | return new ResourceMakeCommand($app['files']); |
70 | 70 | }); |
71 | 71 | } |
72 | 72 | |
73 | 73 | protected function registerAdminActionsCommand() |
74 | 74 | { |
75 | - $this->app->singleton('command.administrator.actions', function ($app) { |
|
75 | + $this->app->singleton('command.administrator.actions', function($app) { |
|
76 | 76 | return new ActionsMakeCommand($app['files']); |
77 | 77 | }); |
78 | 78 | } |
79 | 79 | |
80 | 80 | protected function registerAdminActionCommand() |
81 | 81 | { |
82 | - $this->app->singleton('command.administrator.action', function ($app) { |
|
82 | + $this->app->singleton('command.administrator.action', function($app) { |
|
83 | 83 | return new ActionMakeCommand($app['files']); |
84 | 84 | }); |
85 | 85 | } |
86 | 86 | |
87 | 87 | protected function registerAdminPanelCommand() |
88 | 88 | { |
89 | - $this->app->singleton('command.administrator.panel', function ($app) { |
|
89 | + $this->app->singleton('command.administrator.panel', function($app) { |
|
90 | 90 | return new PanelMakeCommand($app['files']); |
91 | 91 | }); |
92 | 92 | } |
93 | 93 | |
94 | 94 | protected function registerAdminSaverCommand() |
95 | 95 | { |
96 | - $this->app->singleton('command.administrator.saver', function ($app) { |
|
96 | + $this->app->singleton('command.administrator.saver', function($app) { |
|
97 | 97 | return new SaverMakeCommand($app['files']); |
98 | 98 | }); |
99 | 99 | } |
100 | 100 | |
101 | 101 | protected function registerAdminBadgeCommand() |
102 | 102 | { |
103 | - $this->app->singleton('command.administrator.badge', function ($app) { |
|
103 | + $this->app->singleton('command.administrator.badge', function($app) { |
|
104 | 104 | return new BadgeMakeCommand($app['files']); |
105 | 105 | }); |
106 | 106 | } |
107 | 107 | |
108 | 108 | protected function registerAdminTemplateCommand() |
109 | 109 | { |
110 | - $this->app->singleton('command.administrator.template', function ($app) { |
|
110 | + $this->app->singleton('command.administrator.template', function($app) { |
|
111 | 111 | return new TemplateMakeCommand($app['files']); |
112 | 112 | }); |
113 | 113 | } |
114 | 114 | |
115 | 115 | protected function registerAdminFinderCommand() |
116 | 116 | { |
117 | - $this->app->singleton('command.administrator.finder', function ($app) { |
|
117 | + $this->app->singleton('command.administrator.finder', function($app) { |
|
118 | 118 | return new FinderMakeCommand($app['files']); |
119 | 119 | }); |
120 | 120 | } |
121 | 121 | |
122 | 122 | protected function registerAdminBreadcrumbsCommand() |
123 | 123 | { |
124 | - $this->app->singleton('command.administrator.breadcrumbs', function ($app) { |
|
124 | + $this->app->singleton('command.administrator.breadcrumbs', function($app) { |
|
125 | 125 | return new BreadcrumbsMakeCommand($app['files']); |
126 | 126 | }); |
127 | 127 | } |
128 | 128 | |
129 | 129 | protected function registerAdminSettingsCommand() |
130 | 130 | { |
131 | - $this->app->singleton('command.administrator.settings', function ($app) { |
|
131 | + $this->app->singleton('command.administrator.settings', function($app) { |
|
132 | 132 | return new SettingsMakeCommand($app['files']); |
133 | 133 | }); |
134 | 134 | } |
135 | 135 | |
136 | 136 | protected function registerAdminLanguagesCommand() |
137 | 137 | { |
138 | - $this->app->singleton('command.administrator.languages', function ($app) { |
|
138 | + $this->app->singleton('command.administrator.languages', function($app) { |
|
139 | 139 | return new LanguagesMakeCommand($app['files']); |
140 | 140 | }); |
141 | 141 | } |
@@ -8,7 +8,7 @@ |
||
8 | 8 | { |
9 | 9 | public function handle() |
10 | 10 | { |
11 | - app('router')->matched(function (RouteMatched $event) { |
|
11 | + app('router')->matched(function(RouteMatched $event) { |
|
12 | 12 | if (!$this->isAdminArea($event)) { |
13 | 13 | return false; |
14 | 14 | } |
@@ -27,14 +27,14 @@ |
||
27 | 27 | |
28 | 28 | public function handle() |
29 | 29 | { |
30 | - app('router')->matched(function (RouteMatched $event) { |
|
30 | + app('router')->matched(function(RouteMatched $event) { |
|
31 | 31 | if (!$this->isAdminArea($event)) { |
32 | 32 | return false; |
33 | 33 | } |
34 | 34 | |
35 | 35 | if ($manage = $this->config->get('administrator.manage_passwords')) { |
36 | 36 | if ($model = $this->fetchModel($this->config)) { |
37 | - $model::saving(function ($user) { |
|
37 | + $model::saving(function($user) { |
|
38 | 38 | if (!empty($user->password) && $user->isDirty('password')) { |
39 | 39 | $user->password = bcrypt($user->password); |
40 | 40 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | ->without($related->getKeyName()) |
29 | 29 | ->without($this->except) |
30 | 30 | ->only($this->only) |
31 | - ->each(function ($field) { |
|
31 | + ->each(function($field) { |
|
32 | 32 | $field->setId( |
33 | 33 | "{$this->id()}.{$field->id()}" |
34 | 34 | ); |
@@ -143,7 +143,7 @@ |
||
143 | 143 | $first = array_first($parts); |
144 | 144 | $other = array_slice($parts, 1); |
145 | 145 | |
146 | - $other = array_map(function ($part) { |
|
146 | + $other = array_map(function($part) { |
|
147 | 147 | return "[$part]"; |
148 | 148 | }, $other); |
149 | 149 |