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); }
public function index() { $current_series = Series::currentSeries()->first(); $events = Event::featured()->get()->sortBy('sort'); $icampus_times = Campus::findBySlug('online')->times; return view('welcome', ['current_series' => $current_series, 'events' => $events, 'icampus_times' => $icampus_times]); }
private function importVideos() { $table = 'videos'; $items = $this->getVideos(); Video::unguard(); DB::table($table)->truncate(); foreach ($items as $item) { $series = Series::findBySlug($item->series_slug); $speaker = Staff::findBySlug($item->speaker_slug); $data = get_object_vars($item); unset($data['series_slug']); unset($data['speaker_slug']); $model = new Video($data); $model->series_id = $series->id; $model->speaker_id = is_null($speaker) ? null : $speaker->id; $model->save(); } }
public function index() { $latest_sermon = Video::where('type', '=', 'sermon')->orderBy('publish_at', 'desc')->first(); $series = Series::has('videos')->where('is_official', '=', 1)->orderBy('publish_at', 'desc')->get(); return view('sermons', ['series' => $series, 'latest_sermon' => $latest_sermon, 'permalink' => route('seriesVideo', $latest_sermon->Series->slug, $latest_sermon->slug)]); }