public function events(Request $request) { if ($request->start && $request->end) { return Event::whereRaw("start between '" . $request->start . "' and '" . $request->end . "'")->with("order")->get(); } else { return Event::select("*")->get(); } }