@@ -54,7 +54,7 @@ |
||
54 | 54 | |
55 | 55 | $this->value = array_get($inputs, $this->column); |
56 | 56 | |
57 | - $value = array_filter($this->value, function ($val) { |
|
57 | + $value = array_filter($this->value, function($val) { |
|
58 | 58 | return $val !== ''; |
59 | 59 | }); |
60 | 60 |
@@ -158,7 +158,7 @@ |
||
158 | 158 | |
159 | 159 | list($relation, $args[0]) = explode('.', $this->column); |
160 | 160 | |
161 | - return ['whereHas' => [$relation, function ($relation) use ($args) { |
|
161 | + return ['whereHas' => [$relation, function($relation) use ($args) { |
|
162 | 162 | call_user_func_array([$relation, $this->query], $args); |
163 | 163 | }]]; |
164 | 164 | } |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | * |
226 | 226 | * @param array $options |
227 | 227 | * |
228 | - * @return Select |
|
228 | + * @return Presenter\Presenter |
|
229 | 229 | */ |
230 | 230 | public function select($options = []) |
231 | 231 | { |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | /** |
236 | 236 | * @param array $options |
237 | 237 | * |
238 | - * @return MultipleSelect |
|
238 | + * @return Presenter\Presenter |
|
239 | 239 | */ |
240 | 240 | public function multipleSelect($options = []) |
241 | 241 | { |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | /** |
246 | 246 | * @param array $options |
247 | 247 | * |
248 | - * @return Radio |
|
248 | + * @return Presenter\Presenter |
|
249 | 249 | */ |
250 | 250 | public function radio($options = []) |
251 | 251 | { |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | /** |
256 | 256 | * @param array $options |
257 | 257 | * |
258 | - * @return Checkbox |
|
258 | + * @return Presenter\Presenter |
|
259 | 259 | */ |
260 | 260 | public function checkbox($options = []) |
261 | 261 | { |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | * |
268 | 268 | * @param array $options |
269 | 269 | * |
270 | - * @return DateTime |
|
270 | + * @return Presenter\Presenter |
|
271 | 271 | */ |
272 | 272 | public function datetime($options = []) |
273 | 273 | { |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | /** |
278 | 278 | * Date filter. |
279 | 279 | * |
280 | - * @return DateTime |
|
280 | + * @return Presenter\Presenter |
|
281 | 281 | */ |
282 | 282 | public function date() |
283 | 283 | { |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | /** |
288 | 288 | * Time filter. |
289 | 289 | * |
290 | - * @return DateTime |
|
290 | + * @return Presenter\Presenter |
|
291 | 291 | */ |
292 | 292 | public function time() |
293 | 293 | { |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | /** |
298 | 298 | * Day filter. |
299 | 299 | * |
300 | - * @return DateTime |
|
300 | + * @return Presenter\Presenter |
|
301 | 301 | */ |
302 | 302 | public function day() |
303 | 303 | { |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | /** |
308 | 308 | * Month filter. |
309 | 309 | * |
310 | - * @return DateTime |
|
310 | + * @return Presenter\Presenter |
|
311 | 311 | */ |
312 | 312 | public function month() |
313 | 313 | { |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | /** |
318 | 318 | * Year filter. |
319 | 319 | * |
320 | - * @return DateTime |
|
320 | + * @return Presenter\Presenter |
|
321 | 321 | */ |
322 | 322 | public function year() |
323 | 323 | { |
@@ -327,9 +327,9 @@ discard block |
||
327 | 327 | /** |
328 | 328 | * Set presenter object of filter. |
329 | 329 | * |
330 | - * @param Presenter $presenter |
|
330 | + * @param Presenter\Presenter $presenter |
|
331 | 331 | * |
332 | - * @return mixed |
|
332 | + * @return Presenter\Presenter |
|
333 | 333 | */ |
334 | 334 | protected function setPresenter(Presenter $presenter) |
335 | 335 | { |
@@ -134,7 +134,7 @@ |
||
134 | 134 | public function style($style) |
135 | 135 | { |
136 | 136 | if (is_array($style)) { |
137 | - $style = implode('', array_map(function ($key, $val) { |
|
137 | + $style = implode('', array_map(function($key, $val) { |
|
138 | 138 | return "$key:$val"; |
139 | 139 | }, array_keys($style), array_values($style))); |
140 | 140 | } |
@@ -64,7 +64,7 @@ |
||
64 | 64 | return $this->style([$styles]); |
65 | 65 | } |
66 | 66 | |
67 | - $styles = array_map(function ($style) { |
|
67 | + $styles = array_map(function($style) { |
|
68 | 68 | return 'box-'.$style; |
69 | 69 | }, $styles); |
70 | 70 |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * |
13 | 13 | * @param $permission |
14 | 14 | * |
15 | - * @return true |
|
15 | + * @return boolean|null |
|
16 | 16 | */ |
17 | 17 | public static function check($permission) |
18 | 18 | { |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * |
31 | 31 | * @param $roles |
32 | 32 | * |
33 | - * @return true |
|
33 | + * @return boolean|null |
|
34 | 34 | */ |
35 | 35 | public static function allow($roles) |
36 | 36 | { |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * |
49 | 49 | * @param $roles |
50 | 50 | * |
51 | - * @return true |
|
51 | + * @return boolean|null |
|
52 | 52 | */ |
53 | 53 | public static function deny($roles) |
54 | 54 | { |
@@ -22,7 +22,7 @@ |
||
22 | 22 | } |
23 | 23 | |
24 | 24 | if (is_array($permission)) { |
25 | - collect($permission)->each(function ($permission) { |
|
25 | + collect($permission)->each(function($permission) { |
|
26 | 26 | call_user_func([Permission::class, 'check'], $permission); |
27 | 27 | }); |
28 | 28 |
@@ -117,7 +117,7 @@ |
||
117 | 117 | /** |
118 | 118 | * Add form attributes. |
119 | 119 | * |
120 | - * @param string|array $attr |
|
120 | + * @param string $attr |
|
121 | 121 | * @param string $value |
122 | 122 | * |
123 | 123 | * @return $this |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | */ |
163 | 163 | public function setWidth($fieldWidth = 8, $labelWidth = 2) |
164 | 164 | { |
165 | - collect($this->fields)->each(function ($field) use ($fieldWidth, $labelWidth) { |
|
165 | + collect($this->fields)->each(function($field) use ($fieldWidth, $labelWidth) { |
|
166 | 166 | /* @var Field $field */ |
167 | 167 | $field->setWidth($fieldWidth, $labelWidth); |
168 | 168 | }); |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | * |
196 | 196 | * @return $this |
197 | 197 | */ |
198 | - protected function pushField(Field &$field) |
|
198 | + protected function pushField(Field & $field) |
|
199 | 199 | { |
200 | 200 | array_push($this->fields, $field); |
201 | 201 |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | /** |
241 | 241 | * Resolve perPage for pagination. |
242 | 242 | * |
243 | - * @param array|null $paginate |
|
243 | + * @param Model $paginate |
|
244 | 244 | * |
245 | 245 | * @return array |
246 | 246 | */ |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | /** |
263 | 263 | * Find query by method name. |
264 | 264 | * |
265 | - * @param $method |
|
265 | + * @param string $method |
|
266 | 266 | * |
267 | 267 | * @return static |
268 | 268 | */ |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | $this->setSort(); |
195 | 195 | $this->setPaginate(); |
196 | 196 | |
197 | - $this->queries->unique()->each(function ($query) { |
|
197 | + $this->queries->unique()->each(function($query) { |
|
198 | 198 | $this->model = call_user_func_array([$this->model, $query['method']], $query['arguments']); |
199 | 199 | }); |
200 | 200 | |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | { |
219 | 219 | $paginate = $this->findQueryByMethod('paginate'); |
220 | 220 | |
221 | - $this->queries = $this->queries->reject(function ($query) { |
|
221 | + $this->queries = $this->queries->reject(function($query) { |
|
222 | 222 | return $query['method'] == 'paginate'; |
223 | 223 | }); |
224 | 224 | |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | */ |
269 | 269 | protected function findQueryByMethod($method) |
270 | 270 | { |
271 | - return $this->queries->first(function ($query) use ($method) { |
|
271 | + return $this->queries->first(function($query) use ($method) { |
|
272 | 272 | return $query['method'] == $method; |
273 | 273 | }); |
274 | 274 | } |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | { |
314 | 314 | list($relationName, $relationColumn) = explode('.', $column); |
315 | 315 | |
316 | - if ($this->queries->contains(function ($query) use ($relationName) { |
|
316 | + if ($this->queries->contains(function($query) use ($relationName) { |
|
317 | 317 | return $query['method'] == 'with' && in_array($relationName, $query['arguments']); |
318 | 318 | })) { |
319 | 319 | $relation = $this->model->$relationName(); |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | */ |
343 | 343 | public function resetOrderBy() |
344 | 344 | { |
345 | - $this->queries = $this->queries->reject(function ($query) { |
|
345 | + $this->queries = $this->queries->reject(function($query) { |
|
346 | 346 | return $query['method'] == 'orderBy'; |
347 | 347 | }); |
348 | 348 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | /** |
26 | 26 | * Execute the console command. |
27 | 27 | * |
28 | - * @return void |
|
28 | + * @return false|null |
|
29 | 29 | */ |
30 | 30 | public function handle() |
31 | 31 | { |
@@ -58,7 +58,7 @@ |
||
58 | 58 | /** |
59 | 59 | * User logout. |
60 | 60 | * |
61 | - * @return Redirect |
|
61 | + * @return \Illuminate\Http\RedirectResponse |
|
62 | 62 | */ |
63 | 63 | public function getLogout() |
64 | 64 | { |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public function getSetting() |
78 | 78 | { |
79 | - return Admin::content(function (Content $content) { |
|
79 | + return Admin::content(function(Content $content) { |
|
80 | 80 | $content->header(trans('admin.user_setting')); |
81 | 81 | $content->body($this->settingForm()->edit(Admin::user()->id)); |
82 | 82 | }); |
@@ -99,13 +99,13 @@ discard block |
||
99 | 99 | */ |
100 | 100 | protected function settingForm() |
101 | 101 | { |
102 | - return Administrator::form(function (Form $form) { |
|
102 | + return Administrator::form(function(Form $form) { |
|
103 | 103 | $form->display('username', trans('admin.username')); |
104 | 104 | $form->text('name', trans('admin.name'))->rules('required'); |
105 | 105 | $form->image('avatar', trans('admin.avatar')); |
106 | 106 | $form->password('password', trans('admin.password'))->rules('confirmed|required'); |
107 | 107 | $form->password('password_confirmation', trans('admin.password_confirmation'))->rules('required') |
108 | - ->default(function ($form) { |
|
108 | + ->default(function($form) { |
|
109 | 109 | return $form->model()->password; |
110 | 110 | }); |
111 | 111 | |
@@ -113,13 +113,13 @@ discard block |
||
113 | 113 | |
114 | 114 | $form->ignore(['password_confirmation']); |
115 | 115 | |
116 | - $form->saving(function (Form $form) { |
|
116 | + $form->saving(function(Form $form) { |
|
117 | 117 | if ($form->password && $form->model()->password != $form->password) { |
118 | 118 | $form->password = bcrypt($form->password); |
119 | 119 | } |
120 | 120 | }); |
121 | 121 | |
122 | - $form->saved(function () { |
|
122 | + $form->saved(function() { |
|
123 | 123 | admin_toastr(trans('admin.update_succeeded')); |
124 | 124 | |
125 | 125 | return redirect(admin_base_path('auth/setting')); |