diff --git a/app/Traits/Multimedia.php b/app/Traits/Multimedia.php index 54d6aa8..e8702c9 100644 --- a/app/Traits/Multimedia.php +++ b/app/Traits/Multimedia.php @@ -6,6 +6,7 @@ use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Http\Request; use Illuminate\Support\Facades\Log; +use App\Http\Controllers\{PhotoController,VideoController}; use App\Jobs\CatalogDelete; /** @@ -23,8 +24,8 @@ trait Multimedia private function controller(string $type): string { switch (strtolower($type)) { - case 'photo': return 'PhotoController'; - case 'video': return 'VideoController'; + case 'photo': return PhotoController::class; + case 'video': return VideoController::class; default: abort(500,'Type not handled?'); } } @@ -36,8 +37,8 @@ trait Multimedia return redirect() ->action( - sprintf('%s@deletes',$this->controller($request->input('type'))), - sprintf('?page=%s',$request->input('page')) + [$this->controller($request->input('type')),'deletes'], + ['page' => $request->input('page')] ); } @@ -48,8 +49,8 @@ trait Multimedia return redirect() ->action( - sprintf('%s@duplicates',$this->controller($request->input('type'))), - sprintf('?page=%s',$request->input('page')) + [$this->controller($request->input('type')),'duplicates'], + ['page' => $request->input('page')] ); }