Пример #1
0
 public function tutor($id)
 {
     if (!Auth::check()) {
         return Redirect::route('login');
     }
     if (Auth::user()->access == 1) {
         $tutor = Tutor::where('id', $id)->first();
         return View::make('tutor')->with(compact('tutor'));
     }
     $tutor = Tutor::where('users_id', Auth::user()->id)->first();
     return View::make('tutor')->with(compact('tutor'));
 }
Пример #2
0
 private function tutor()
 {
     $email = Request::getUser();
     $password = Request::getPassword();
     $userAuth = Input::get('userAuth', false);
     if (isset($email) && isset($password) && !$userAuth) {
         $tutor = Tutor::where('email', $email)->first();
         return $tutor && Hash::check($password, $tutor->password) ? $tutor : null;
     } else {
         return false;
     }
 }