Test Setup Failed
Push — a-simpler-manager ( 22727d...b5bd49 )
by Ben
07:02
created
src/Managers/Assistants/FragmentAssistant.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -31,18 +31,18 @@  discard block
 block discarded – undo
31 31
 
32 32
     public function routeFragmentAssistant(string $action, $model = null, ...$parameters): ?string
33 33
     {
34
-        if(!in_array($action, ['fragment-edit','fragment-update','fragment-delete','fragment-create','fragment-store'])) {
34
+        if (!in_array($action, ['fragment-edit', 'fragment-update', 'fragment-delete', 'fragment-create', 'fragment-store'])) {
35 35
             return null;
36 36
         }
37 37
 
38 38
         $modelKey = $this->managedModelClass()::managedModelKey();
39 39
 
40
-        if(in_array($action, ['fragment-create', 'fragment-store'])) {
40
+        if (in_array($action, ['fragment-create', 'fragment-store'])) {
41 41
             if (!$model || !$model instanceof FragmentsOwner) {
42 42
                 throw new \Exception('Fragment route definition for '.$action.' requires the owning Model as second argument.');
43 43
             }
44 44
 
45
-            return route('chief.' . $modelKey . '.' . $action, array_merge([
45
+            return route('chief.'.$modelKey.'.'.$action, array_merge([
46 46
                 $model::managedModelKey(),
47 47
                 $model->modelReference()->id(),
48 48
             ], $parameters));
@@ -52,12 +52,12 @@  discard block
 block discarded – undo
52 52
             throw new \Exception('Fragment route definition for '.$action.' requires the fragment model as second argument.');
53 53
         }
54 54
 
55
-        return route('chief.' . $modelKey . '.' . $action, $model->fragmentModel()->id);
55
+        return route('chief.'.$modelKey.'.'.$action, $model->fragmentModel()->id);
56 56
     }
57 57
 
58 58
     public function canFragmentAssistant(string $action, $model = null): bool
59 59
     {
60
-        return in_array($action, ['fragment-edit','fragment-update','fragment-delete','fragment-create','fragment-store']);
60
+        return in_array($action, ['fragment-edit', 'fragment-update', 'fragment-delete', 'fragment-create', 'fragment-store']);
61 61
     }
62 62
 
63 63
     public function fragmentCreate(Request $request, string $ownerKey, $ownerId)
@@ -144,13 +144,13 @@  discard block
 block discarded – undo
144 144
         $model = $this->managedModelClass()::findOrFail($id);
145 145
 
146 146
         if ($request->get('deleteconfirmation') !== 'DELETE') {
147
-            return redirect()->back()->with('messages.warning', $model->adminLabel('title') . ' is niet verwijderd.');
147
+            return redirect()->back()->with('messages.warning', $model->adminLabel('title').' is niet verwijderd.');
148 148
         }
149 149
 
150 150
         app(DeleteModel::class)->handle($model);
151 151
 
152 152
         return redirect()->to($this->route('index'))
153
-            ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i>  "' . $model->adminLabel('title') . '" is verwijderd.');
153
+            ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i>  "'.$model->adminLabel('title').'" is verwijderd.');
154 154
     }
155 155
 
156 156
     private function owner(string $ownerKey, $ownerId): FragmentsOwner
Please login to merge, or discard this patch.