public function index() { $urls = []; $routes = Route::getRoutes(); foreach ($routes as $route) { $path = $route->getPath(); $actions = $route->getAction(); $params = $route->parameterNames(); $controller = $actions['controller']; if (starts_with($path, '_') or str_contains($controller, 'RedirectController') or count($params)) { continue; } $urls[] = url($path); } foreach (Campus::all() as $item) { $urls[] = url($item->url); } foreach (Event::all() as $item) { $urls[] = url($item->url); } foreach (Series::withDrafts()->get() as $item) { $urls[] = url($item->url); } foreach (Staff::all() as $item) { $urls[] = url($item->url); } foreach (MissionLocation::all() as $item) { $urls[] = url($item->url); } foreach (Video::withDrafts()->get() as $item) { $urls[] = url($item->url); } return response()->json($urls); }
/** * Execute the console command. * * @return mixed */ public function handle() { $staff = Staff::all(); $staff->each(function ($staffer) { $has_image = asset_exists($staffer->image_path) ? 1 : 0; if ($staffer->has_image != $has_image) { $staffer->has_image = $has_image; $staffer->save(); } }); }