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]);
 }
 public function event($event)
 {
     // If a the event has a (hard coded) URL, redirect to it
     if (strlen($event->original_url)) {
         return redirect($event->original_url);
     }
     if (is_null($event)) {
         // LATER: Serve up another view that suggests events
         abort(404);
     }
     $events = Event::orderBy('sort', 'asc')->take(3)->get();
     return view('event_detail', ['event' => $event, 'events' => $events]);
 }
 private function importEvents()
 {
     $table = 'events';
     $items = $this->getEvents();
     Event::unguard();
     DB::table($table)->truncate();
     foreach ($items as $item) {
         $data = get_object_vars($item);
         $ministry_slug = $data['ministry_slug'];
         unset($data['ministry_slug']);
         $ministry = Ministry::findBySlug($ministry_slug);
         if (!is_null($ministry)) {
             $data['ministry_id'] = $ministry->id;
         }
         $model = new Event($data);
         $model->save();
     }
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     return Event::all();
 }