Example #1
0
 public function listByCategory($slug)
 {
     $category = Category::slug($slug)->withEvents()->first();
     if (!is_null($category)) {
         $data = ['category' => $category, 'categories' => Category::withEvents()->get(), 'events' => $category->events];
         return view('site.events.list-by-category', $data);
     } else {
         return abort(404);
     }
 }
Example #2
0
 public function index()
 {
     $data = ['slides' => Slider::all(), 'categories' => Category::withEvents()->get(), 'events' => Event::getComingSoonEvents()];
     $data['quantity_slides'] = count($data['slides']);
     return view('site.home.index', $data);
 }