public function getSchoolPeriods() { $schedules = SchoolSchedule::where('school_id', '=', $this->getschoolId())->where('school_session_id', '=', $this->getSchoolSessionId())->get(); $current_schedule = SchoolSchedule::where('school_id', '=', $this->getSchoolId())->where('current_schedule', '=', 1)->get()->first(); $periods_profiles = PeriodProfile::where('school_id', '=', $this->getSchoolId())->get(); $current_periods_profiles = PeriodProfile::where('school_id', '=', $this->getSchoolId())->where('current_profile', '=', 1)->get(); $periods = Periods::all(); //$periods = "hello"; return View::make('admin.school-periods')->with('periods_profiles', $periods_profiles)->with('current_periods_profiles', $current_periods_profiles)->with('schedules', $schedules); }