mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-23 19:50:40 -05:00
refactor: reduce temporary variables passed to views
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user