id; } return null; } /** * Validate a user's credentials. * * @param array $credentials * @return bool */ public function validate(array $credentials = []) { return SentinelFacade::validForCreation($credentials); } /** * Set the current user. * * @param \Illuminate\Contracts\Auth\Authenticatable $user * @param \Modules\User\Entities\User|bool */ public function setUser(Authenticatable $user) { return SentinelFacade::login($user); } /** * Alias to set the current user. * * @param \Illuminate\Contracts\Auth\Authenticatable $user * @return \Modules\User\Entities\User|bool */ public function login(Authenticatable $user) { return $this->setUser($user); } /** * Attempt to logging in user. * * @param array $credentials * @param bool $remember * @return \Modules\User\Entities\User|bool */ public function attempt(array $credentials, $remember = false) { return SentinelFacade::authenticate($credentials, $remember); } /** * Logout user. * * @return bool */ public function logout() { return SentinelFacade::logout(); } /** * Login using user id. * * @param int $userId * @return \Modules\User\Entities\User|bool */ public function loginUsingId($userId) { $user = User::findOrFail($userId); return $this->login($user); } public function hasUser() { // TODO: Implement hasUser() method. } }