Example #1
0
 public function dashboard()
 {
     // User
     $user = Auth::user();
     // Upcoming events
     $upcomingEvents = Event::upcoming($user)->get();
     // Past events
     $pastEvents = $user->attending()->past();
     if ($user->hasType('normal')) {
         // Tags
         $tags = $user->tags;
         // Suggested events
         $suggestedEvents = Event::suggested()->limit(4)->get();
         return view('users.dashboard.base-normal', compact('user', 'tags', 'suggestedEvents', 'upcomingEvents', 'pastEvents'));
     } else {
         return view('users.dashboard.base-organiser', compact('user', 'upcomingEvents', 'pastEvents'));
     }
 }