public function getJsonEvents() { // Calendar $events = calendarevent::where('doctor_id', Auth::user()->id)->where('type', calendarevent::TYPE_SHORT)->where('status', '<>', calendarevent::STATUS_PENDING)->get(); $event_jsons = []; foreach ($events as $event) { $event_jsons[] = json_encode(array('title' => $event->title, 'start' => $event->start_time, 'end' => $event->end_time)); } return $event_jsons; }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // Clients $clients = player_has_doctor::where('doctor_id', Auth::user()->id)->where('status', player_has_doctor::STATUS_ACCEPTED)->get(); $requests = player_has_doctor::where('doctor_id', Auth::user()->id)->where('status', player_has_doctor::STATUS_PENDING)->get(); // Calendar $cal_events = calendarevent::where('doctor_id', Auth::user()->id)->where('type', calendarevent::TYPE_SHORT)->where('status', '<>', calendarevent::STATUS_PENDING)->get(); $event_requests = calendarevent::where('doctor_id', Auth::user()->id)->where('type', calendarevent::TYPE_SHORT)->where('status', calendarevent::STATUS_PENDING)->get(); return view('doctor.doctor_home', ['clients' => $clients, 'requests' => $requests, 'cal_events' => $cal_events, 'event_requests' => $event_requests]); }