Example #1
0
 public function dashboard()
 {
     $upcoming_meetings = Meeting::where('start', '>', Carbon::now())->orderBy('start')->take(4)->get();
     $previous_meetings = Meeting::where('start', '<', Carbon::now())->orderBy('start', 'desc')->take(5)->get();
     //$meetings = Meeting::find(704)->topics;
     // return $meeting = Meeting::find(704)->topics()->first();
     return view('dashboard', ['alert_count' => '69', 'upcoming_meetings' => $upcoming_meetings, 'previous_meetings' => $previous_meetings]);
 }
 function meetings(Request $request)
 {
     switch ($request->input('filter')) {
         case 'future':
             return response()->json(Meeting::where('start_date', '>', Carbon::today()->timestamp)->get());
         default:
             return response()->json(Meeting::all());
     }
 }