public function index() { $academies = Academy::all(); // $academy_id = Session::get('school_id_session'); $academy_id = Cookie::get('school_id_session'); $school = Academy::where('id', $academy_id)->first(); // dd(var_dump($school)); if ($school != NULL) { return Redirect::to("/school/{$academy_id}"); } return View::make('home.index')->with('academies', $academies); }
public function allAcademies() { return Academy::all(); }
public function allSchools() { $academies = Academy::all(); return $academies; }
public function subCategory($academy_id, $category_id) { // Session::set('school_id_session', $academy_id); Cookie::queue('school_id_session', $academy_id, 7 * 24 * 60); // 7 days $myAcademy = Academy::where('id', $academy_id)->first(); $academies = Academy::all(); $categories = Category::all(); $tasks = Task::where(['place' => $academy_id, 'category_id' => $category_id])->orderBy('created_at', 'desc')->paginate(10); return View::make('task.list')->with('tasks', $tasks)->with('mySchool', $myAcademy)->with('schools', $academies)->with('category_id', $category_id)->with('categories', $categories); }