get('type'); // When clearing the application, clear the config and the app itself if ($type === 'application' || $type === 'all') { $calls[] = 'config:cache'; $calls[] = 'cache:clear'; $calls[] = 'route:cache'; } // If we want to clear only the views but keep everything else if ($type === 'views' || $type === 'all') { $calls[] = 'view:clear'; } foreach ($calls as $call) { Artisan::call($call); } Flash::success('Cache cleared!'); return redirect(route('admin.maintenance.index')); } }