public function getSchoolSettings() { $school = Schools::find($this->getSchoolId()); $schedule = SchoolSchedule::where('school_id', '=', $this->getschoolId())->where('school_session_id', '=', $this->getSchoolSessionId())->get(); $sessions = SchoolSession::where('school_id', '=', $this->getschoolId())->get(); $current_session = SchoolSession::where('school_id', '=', $this->getschoolId())->where('current_session', '=', 1)->get()->first(); return View::make('admin.school-settings')->with('schedules', $schedule)->with('sessions', $sessions)->with('school', $school)->with('current_session', $current_session); }