refactor: reduce temporary variables passed to views

This commit is contained in:
Roardom
2023-06-19 21:17:10 +00:00
parent 1fa4a3e506
commit d2e36c368e
70 changed files with 1179 additions and 1321 deletions
+5 -5
View File
@@ -56,10 +56,10 @@ class SubtitleController extends Controller
*/
public function create(int $torrentId): \Illuminate\Contracts\View\Factory|\Illuminate\View\View
{
$torrent = Torrent::withAnyStatus()->findOrFail($torrentId);
$mediaLanguages = MediaLanguage::orderBy('name')->get();
return view('subtitle.create', ['torrent' => $torrent, 'media_languages' => $mediaLanguages]);
return view('subtitle.create', [
'torrent' => Torrent::withAnyStatus()->findOrFail($torrentId),
'media_languages' => MediaLanguage::orderBy('name')->get(),
]);
}
/**
@@ -184,7 +184,7 @@ class SubtitleController extends Controller
$subtitle->delete();
return to_route('torrent', ['id' => $request->input('torrent_id')])
return to_route('torrent', ['id' => $request->integer('torrent_id')])
->withSuccess('Subtitle Successfully Deleted');
}