/** * Authenticate a user by username and password. * * @param string $username The username * @param string $password Plain text password * @return bool|user The user if the password matches the user's stored password, false otherwise. */ public function authenticate($username, $password) { $user = User::where('username', $username)->first(); if (!Hash::check($password, $user->password)) { return false; } return $user; }
/** * Authenticate a user by username and password. * * @param string $email The username * @param string $password Plain text password * @return bool|user The user if the password matches the user's stored password, false otherwise. */ public function authenticate($email, $password) { $user = User::where('email', $email)->first(); if ($user) { if (Hash::check($password, $user->password)) { return $user; } } return false; }
/** * Carga la información del perfil de un usuario. * * @param int $url * @return Response */ public function show($url) { $usrIn = $this->req->input('userIn'); //$this->guardarVisitaPerfil($url, $usrIn); $usuario = User::where('url', '=', $url)->where('bloqued', false)->first(); if ($usuario) { $this->guardarVisitaPerfil($usuario, $usrIn); } //Event::fire(UserUpdatedEventHandler::EVENT, $usuario); event(new \Camp\Handlers\Events\UserUpdatedEventHandler(User::all())); return $usuario; }