@@ -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 | } |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | $this->hideSensitiveRequestDetails(); |
| 22 | 22 | |
| 23 | - Telescope::filter(function (IncomingEntry $entry) { |
|
| 23 | + Telescope::filter(function(IncomingEntry $entry) { |
|
| 24 | 24 | if ($this->app->isLocal()) { |
| 25 | 25 | return true; |
| 26 | 26 | } |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | return; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - Telescope::hideRequestParameters(['_token']); |
|
| 46 | + Telescope::hideRequestParameters([ '_token' ]); |
|
| 47 | 47 | |
| 48 | 48 | Telescope::hideRequestHeaders([ |
| 49 | 49 | 'cookie', |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | protected function gate() |
| 63 | 63 | { |
| 64 | - Gate::define('viewTelescope', function ($user) { |
|
| 64 | + Gate::define('viewTelescope', function($user) { |
|
| 65 | 65 | return in_array($user->email, [ |
| 66 | 66 | // |
| 67 | 67 | ]); |
@@ -37,10 +37,10 @@ |
||
| 37 | 37 | */ |
| 38 | 38 | public function handle() |
| 39 | 39 | { |
| 40 | - $uploadsFolder = 'public/' . config('soundboard.folders.uploads'); |
|
| 40 | + $uploadsFolder = 'public/'.config('soundboard.folders.uploads'); |
|
| 41 | 41 | |
| 42 | - echo shell_exec('rm -R -f ' . $uploadsFolder); |
|
| 43 | - echo shell_exec('git clone '.config('soundboard.seededSoundsRepository') .' ' . $uploadsFolder); |
|
| 44 | - echo shell_exec('rm -f ' . $uploadsFolder . '/LICENSE ' . $uploadsFolder . '/README.md'); |
|
| 42 | + echo shell_exec('rm -R -f '.$uploadsFolder); |
|
| 43 | + echo shell_exec('git clone '.config('soundboard.seededSoundsRepository').' '.$uploadsFolder); |
|
| 44 | + echo shell_exec('rm -f '.$uploadsFolder.'/LICENSE '.$uploadsFolder.'/README.md'); |
|
| 45 | 45 | } |
| 46 | 46 | } |
@@ -37,10 +37,10 @@ |
||
| 37 | 37 | */ |
| 38 | 38 | public function handle() |
| 39 | 39 | { |
| 40 | - $uploadsFolder = 'public/' . config('soundboard.folders.uploads'); |
|
| 40 | + $uploadsFolder = 'public/'.config('soundboard.folders.uploads'); |
|
| 41 | 41 | |
| 42 | - echo shell_exec('rm -R -f ' . $uploadsFolder); |
|
| 43 | - echo shell_exec('git clone '.config('soundboard.soundsRepository') .' ' . $uploadsFolder); |
|
| 42 | + echo shell_exec('rm -R -f '.$uploadsFolder); |
|
| 43 | + echo shell_exec('git clone '.config('soundboard.soundsRepository').' '.$uploadsFolder); |
|
| 44 | 44 | echo shell_exec('rm -f public/sound-files/LICENSE public/sound-files/README.md'); |
| 45 | 45 | } |
| 46 | 46 | } |
@@ -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 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 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 | |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | $extension = 'wav'; |
| 132 | 132 | $name = $original_name.'.'.$extension; |
| 133 | 133 | |
| 134 | - $path = config('soundboard.folders.recordings') . "/"; |
|
| 134 | + $path = config('soundboard.folders.recordings')."/"; |
|
| 135 | 135 | if (!File::exists($path)) { |
| 136 | 136 | File::makeDirectory($path); |
| 137 | 137 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | } |
| 147 | 147 | $storedFile = $file->storeAs(config('soundboard.folders.recordings'), $name, config('soundboard.folders.uploads')); |
| 148 | 148 | |
| 149 | - ActivityLogger::activity('New file recorded: ' . $name); |
|
| 149 | + ActivityLogger::activity('New file recorded: '.$name); |
|
| 150 | 150 | |
| 151 | 151 | return response()->json([ |
| 152 | 152 | 'message' => 'File Recorded: '.$name, |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | public static function storeNewSound($soundData) |
| 102 | 102 | { |
| 103 | 103 | $lastSound = collect(Sound::sortedSounds()->get())->last(); |
| 104 | - $sort_order = ['sort_order' => $lastSound->sort_order + 1]; |
|
| 104 | + $sort_order = [ 'sort_order' => $lastSound->sort_order + 1 ]; |
|
| 105 | 105 | $newSound = Sound::create(array_merge($soundData, $sort_order)); |
| 106 | 106 | |
| 107 | 107 | return $newSound; |
@@ -128,8 +128,8 @@ discard block |
||
| 128 | 128 | */ |
| 129 | 129 | public static function checkAndPullSoundsAndRecordings() |
| 130 | 130 | { |
| 131 | - $uploadedFilePath = config('soundboard.folders.uploads') . "/"; |
|
| 132 | - $recordedFilePath = $uploadedFilePath . config('soundboard.folders.recordings') . "/"; |
|
| 131 | + $uploadedFilePath = config('soundboard.folders.uploads')."/"; |
|
| 132 | + $recordedFilePath = $uploadedFilePath.config('soundboard.folders.recordings')."/"; |
|
| 133 | 133 | $fileTypes = 'wav'; |
| 134 | 134 | |
| 135 | 135 | if (!File::exists($uploadedFilePath)) { |
@@ -140,8 +140,8 @@ discard block |
||
| 140 | 140 | File::makeDirectory($recordedFilePath); |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | - $uploadfilesNames = collect(preg_grep('~\.(' . $fileTypes . ')$~', scandir($uploadedFilePath))); |
|
| 144 | - $recordedfilesNames = collect(preg_grep('~\.(' . $fileTypes . ')$~', scandir($recordedFilePath))); |
|
| 143 | + $uploadfilesNames = collect(preg_grep('~\.('.$fileTypes.')$~', scandir($uploadedFilePath))); |
|
| 144 | + $recordedfilesNames = collect(preg_grep('~\.('.$fileTypes.')$~', scandir($recordedFilePath))); |
|
| 145 | 145 | |
| 146 | 146 | $data = [ |
| 147 | 147 | 'uploadfilesNames' => $uploadfilesNames, |