¨4.0.1¨

This commit is contained in:
¨NW¨
2023-12-03 14:07:47 +00:00
parent c08b36d1b6
commit f35052522d
1112 changed files with 43019 additions and 24987 deletions

View File

@@ -9,36 +9,28 @@ use Cartalyst\Sentinel\Laravel\Facades\Sentinel as SentinelFacade;
class Sentinel implements Guard
{
/**
* Determine if the current user is authenticated.
*
* @return \Modules\User\Entities\User|bool
*/
public function check()
{
return SentinelFacade::check();
}
/**
* Determine if the current user is a guest.
*
* @return \Modules\User\Entities\User|bool
* @return User|bool
*/
public function guest()
{
return SentinelFacade::guest();
}
/**
* Get the currently authenticated user.
*
* @return \Illuminate\Contracts\Auth\Authenticatable|null
* @return Authenticatable|null
*/
public function user()
{
return SentinelFacade::getUser();
}
/**
* Get the ID for the currently authenticated user.
*
@@ -53,10 +45,23 @@ class Sentinel implements Guard
return null;
}
/**
* Determine if the current user is authenticated.
*
* @return User|bool
*/
public function check()
{
return SentinelFacade::check();
}
/**
* Validate a user's credentials.
*
* @param array $credentials
*
* @return bool
*/
public function validate(array $credentials = [])
@@ -64,40 +69,46 @@ class Sentinel implements Guard
return SentinelFacade::validForCreation($credentials);
}
/**
* Set the current user.
*
* @param \Illuminate\Contracts\Auth\Authenticatable $user
* @param \Modules\User\Entities\User|bool
* @param Authenticatable $user
* @param 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
* @param Authenticatable $user
*
* @return 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
*
* @return User|bool
*/
public function attempt(array $credentials, $remember = false)
{
return SentinelFacade::authenticate($credentials, $remember);
}
/**
* Logout user.
*
@@ -108,11 +119,13 @@ class Sentinel implements Guard
return SentinelFacade::logout();
}
/**
* Login using user id.
*
* @param int $userId
* @return \Modules\User\Entities\User|bool
*
* @return User|bool
*/
public function loginUsingId($userId)
{