/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $files = File::with('file_type')->get(); if (isset($_GET['grid'])) { $types = FileType::all(); return view('admin.files.viewByType', ['types' => $types, 'files' => $files]); } return view('admin.files.viewAll', ['files' => $files]); }