@@ -60,8 +60,7 @@ discard block |
||
60 | 60 | $this->fields->hydrateErrorsFromSession(); |
61 | 61 | $this->fields->hydrateFieldsFromSession(); |
62 | 62 | } |
63 | - } |
|
64 | - else |
|
63 | + } else |
|
65 | 64 | { |
66 | 65 | throw new InvalidModelException("The model must use Crudable trait."); |
67 | 66 | } |
@@ -147,8 +146,7 @@ discard block |
||
147 | 146 | 'csrf_field' => csrf_field(), |
148 | 147 | 'method_field' => method_field($method), |
149 | 148 | ]; |
150 | - } |
|
151 | - else |
|
149 | + } else |
|
152 | 150 | { |
153 | 151 | $view_name = 'crud::form-update'; |
154 | 152 | $method = $this->manager->getActionMethod('update'); |
@@ -38,7 +38,7 @@ |
||
38 | 38 | /** |
39 | 39 | * CrudEntry constructor. |
40 | 40 | * |
41 | - * @param Model|Crudable $model |
|
41 | + * @param Model $model |
|
42 | 42 | * @throws \InvalidArgumentException |
43 | 43 | */ |
44 | 44 | public function __construct(Model $model) |
@@ -62,8 +62,7 @@ |
||
62 | 62 | { |
63 | 63 | $this->addRule($rule); |
64 | 64 | } |
65 | - } |
|
66 | - else |
|
65 | + } else |
|
67 | 66 | { |
68 | 67 | if (is_string($rules)) |
69 | 68 | { |
@@ -311,7 +311,7 @@ |
||
311 | 311 | * Get the field value. |
312 | 312 | * |
313 | 313 | * @param void |
314 | - * @return mixed |
|
314 | + * @return string |
|
315 | 315 | */ |
316 | 316 | public function getValue() |
317 | 317 | { |
@@ -62,8 +62,7 @@ |
||
62 | 62 | { |
63 | 63 | $this->addRule($rule); |
64 | 64 | } |
65 | - } |
|
66 | - else |
|
65 | + } else |
|
67 | 66 | { |
68 | 67 | if (is_string($rules)) |
69 | 68 | { |
@@ -62,8 +62,7 @@ |
||
62 | 62 | { |
63 | 63 | $this->addRule($rule); |
64 | 64 | } |
65 | - } |
|
66 | - else |
|
65 | + } else |
|
67 | 66 | { |
68 | 67 | if (is_string($rules)) |
69 | 68 | { |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | 'prefix' => $this->route_uri_prefix, |
254 | 254 | 'as' => $this->route_name_prefix, |
255 | 255 | 'middleware' => 'web' |
256 | - ], function (Router $router) use ($routes, $controller) |
|
256 | + ], function(Router $router) use ($routes, $controller) |
|
257 | 257 | { |
258 | 258 | foreach ($routes as $route) |
259 | 259 | { |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | */ |
296 | 296 | public function setPerPage($per_page = 25) |
297 | 297 | { |
298 | - $this->per_page = (int)$per_page; |
|
298 | + $this->per_page = (int) $per_page; |
|
299 | 299 | |
300 | 300 | return $this; |
301 | 301 | } |
@@ -24,12 +24,10 @@ discard block |
||
24 | 24 | if (is_string($crudable)) |
25 | 25 | { |
26 | 26 | return new CrudTable(new $crudable); |
27 | - } |
|
28 | - else if ($crudable instanceof CrudTable) |
|
27 | + } else if ($crudable instanceof CrudTable) |
|
29 | 28 | { |
30 | 29 | return $crudable; |
31 | - } |
|
32 | - else if (is_object($crudable) && array_key_exists(Crudable::class, class_uses($crudable))) |
|
30 | + } else if (is_object($crudable) && array_key_exists(Crudable::class, class_uses($crudable))) |
|
33 | 31 | { |
34 | 32 | return new CrudTable($crudable); |
35 | 33 | } |
@@ -47,12 +45,10 @@ discard block |
||
47 | 45 | if (is_string($crudable)) |
48 | 46 | { |
49 | 47 | return new CrudEntry(new $crudable); |
50 | - } |
|
51 | - else if ($crudable instanceof CrudEntry) |
|
48 | + } else if ($crudable instanceof CrudEntry) |
|
52 | 49 | { |
53 | 50 | return $crudable; |
54 | - } |
|
55 | - else if (is_object($crudable) && array_key_exists(Crudable::class, class_uses($crudable))) |
|
51 | + } else if (is_object($crudable) && array_key_exists(Crudable::class, class_uses($crudable))) |
|
56 | 52 | { |
57 | 53 | return new CrudEntry($crudable); |
58 | 54 | } |
@@ -97,7 +97,7 @@ |
||
97 | 97 | |
98 | 98 | if (count($rules) > 0) |
99 | 99 | { |
100 | - $validator->sometimes($this->getIdentifier(), $rules, function (Fluent $input) use ($identifier) |
|
100 | + $validator->sometimes($this->getIdentifier(), $rules, function(Fluent $input) use ($identifier) |
|
101 | 101 | { |
102 | 102 | return is_null($input->{$identifier}) ? false : true; |
103 | 103 | }); |