@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | { |
50 | 50 | $sound = SoundServices::getBlankSound(); |
51 | 51 | |
52 | - return view('pages.sounds.create', ['sound' => $sound]); |
|
52 | + return view('pages.sounds.create', [ 'sound' => $sound ]); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $validated = $request->validated(); |
65 | 65 | $sound = SoundServices::storeNewSound($validated); |
66 | 66 | |
67 | - ActivityLogger::activity('New sound created: ' . $sound); |
|
67 | + ActivityLogger::activity('New sound created: '.$sound); |
|
68 | 68 | |
69 | 69 | return redirect('sounds') |
70 | 70 | ->with('success', 'Sound created: <strong>'.$sound->title.'</strong>'); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | { |
82 | 82 | $sound = SoundServices::getSound($id); |
83 | 83 | |
84 | - return view('pages.sounds.show', ['sound' => $sound]); |
|
84 | + return view('pages.sounds.show', [ 'sound' => $sound ]); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | { |
96 | 96 | $sound = SoundServices::getSound($id); |
97 | 97 | |
98 | - return view('pages.sounds.edit', ['sound' => $sound]); |
|
98 | + return view('pages.sounds.edit', [ 'sound' => $sound ]); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | $validated = $request->validated(); |
112 | 112 | $sound = SoundServices::updateSound(SoundServices::getSound($id), $validated); |
113 | 113 | |
114 | - ActivityLogger::activity('Sounds updated: ' . $sound); |
|
114 | + ActivityLogger::activity('Sounds updated: '.$sound); |
|
115 | 115 | |
116 | 116 | return redirect() |
117 | 117 | ->back() |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | { |
130 | 130 | $sound = SoundServices::deleteSound(SoundServices::getSound($id)); |
131 | 131 | |
132 | - ActivityLogger::activity('Sounds deleted: ' . $sound); |
|
132 | + ActivityLogger::activity('Sounds deleted: '.$sound); |
|
133 | 133 | |
134 | 134 | return redirect('sounds')->with('success', 'Sound deleted <strong>'.$sound->title.'</strong>'); |
135 | 135 | } |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | foreach ($sounds as $sound) { |
50 | 50 | $id = $sound->id; |
51 | 51 | foreach ($request->sounds as $soundsNew) { |
52 | - if ($soundsNew['id'] == $id) { |
|
53 | - $sound->update(['sort_order' => $soundsNew['sort_order']]); |
|
52 | + if ($soundsNew[ 'id' ] == $id) { |
|
53 | + $sound->update([ 'sort_order' => $soundsNew[ 'sort_order' ] ]); |
|
54 | 54 | } |
55 | 55 | } |
56 | 56 | } |
@@ -77,12 +77,12 @@ discard block |
||
77 | 77 | $this->validate($request, [ |
78 | 78 | 'sound.enabled' => 'required|boolean', |
79 | 79 | ]); |
80 | - $sound = SoundServices::updateSoundStatus($id, $request->sound['enabled']); |
|
80 | + $sound = SoundServices::updateSoundStatus($id, $request->sound[ 'enabled' ]); |
|
81 | 81 | $status = 'disabled'; |
82 | 82 | if ($sound->enabled) { |
83 | 83 | $status = 'enabled'; |
84 | 84 | } |
85 | - $message = trans('admin.messages.status-updated', ['status' => $status, 'title' => $sound->title]); |
|
85 | + $message = trans('admin.messages.status-updated', [ 'status' => $status, 'title' => $sound->title ]); |
|
86 | 86 | |
87 | 87 | ActivityLogger::activity($message); |
88 | 88 | |
@@ -105,10 +105,10 @@ discard block |
||
105 | 105 | |
106 | 106 | $sound = SoundServices::deleteSound(SoundServices::getSound($id)); |
107 | 107 | |
108 | - ActivityLogger::activity('Sounds deleted: ' . $sound); |
|
108 | + ActivityLogger::activity('Sounds deleted: '.$sound); |
|
109 | 109 | |
110 | 110 | return response()->json([ |
111 | - 'message' => trans('admin.messages.sound-deleted', ['title' => $sound->title]) |
|
111 | + 'message' => trans('admin.messages.sound-deleted', [ 'title' => $sound->title ]) |
|
112 | 112 | ], 200); |
113 | 113 | } |
114 | 114 | } |
@@ -26,7 +26,7 @@ |
||
26 | 26 | public static function checkIsUserAdminOrHigher($userId) |
27 | 27 | { |
28 | 28 | $user = self::getUser($userId); |
29 | - if (!$user->hasRole(['admin', 'super.admin'])) { |
|
29 | + if (!$user->hasRole([ 'admin', 'super.admin' ])) { |
|
30 | 30 | abort(401); |
31 | 31 | } |
32 | 32 | } |