@@ -39,7 +39,9 @@ discard block |
||
39 | 39 | |
40 | 40 | public function canCrudAssistant(string $action, $model = null): bool |
41 | 41 | { |
42 | - if(!in_array($action, ['index', 'create', 'store', 'edit', 'update', 'delete'])) return false; |
|
42 | + if(!in_array($action, ['index', 'create', 'store', 'edit', 'update', 'delete'])) { |
|
43 | + return false; |
|
44 | + } |
|
43 | 45 | |
44 | 46 | try { |
45 | 47 | |
@@ -58,9 +60,13 @@ discard block |
||
58 | 60 | return false; |
59 | 61 | } |
60 | 62 | |
61 | - if(in_array($action, ['index', 'create', 'store'])) return true; |
|
63 | + if(in_array($action, ['index', 'create', 'store'])) { |
|
64 | + return true; |
|
65 | + } |
|
62 | 66 | |
63 | - if(!$model || !$model instanceof StatefulContract) return true; |
|
67 | + if(!$model || !$model instanceof StatefulContract) { |
|
68 | + return true; |
|
69 | + } |
|
64 | 70 | |
65 | 71 | // Model cannot be in deleted state for editing purposes. |
66 | 72 | if(in_array($action, ['edit', 'update'])) { |