Bristol SU Support Package
src
User
UserWebAuthentication.php
Go to the documentation of this file.
1
<?php
2
3
namespace
BristolSU\Support\User
;
4
5
use
BristolSU\Support\User\Contracts\UserAuthentication
;
6
use Illuminate\Contracts\Auth\Factory as AuthFactory;
7
11
class
UserWebAuthentication
implements
UserAuthentication
12
{
13
19
private
$auth
;
20
24
public
function
__construct
(AuthFactory
$auth
)
25
{
26
$this->auth =
$auth
;
27
}
28
34
public
function
getUser
(): ?
User
35
{
36
if
($this->auth->guard(
'web'
)->check()) {
37
return
$this->auth->guard(
'web'
)->user();
38
}
39
return
null;
40
}
41
47
public
function
setUser
(
User
$user)
48
{
49
$this->auth->guard(
'web'
)->login($user);
50
}
51
57
public
function
logout
(): void
58
{
59
$this->auth->guard(
'web'
)->logout();
60
}
61
}
BristolSU\Support\User\UserWebAuthentication\logout
logout()
Definition:
UserWebAuthentication.php:57
BristolSU\Support\User
BristolSU\Support\User\UserWebAuthentication\getUser
getUser()
Definition:
UserWebAuthentication.php:34
BristolSU\Support\User\Contracts\UserAuthentication
Definition:
UserAuthentication.php:10
BristolSU\Support\User\UserWebAuthentication\setUser
setUser(User $user)
Definition:
UserWebAuthentication.php:47
BristolSU\Support\User\UserWebAuthentication
Definition:
UserWebAuthentication.php:11
BristolSU\Support\User\User
Definition:
User.php:15
BristolSU\Support\User\UserWebAuthentication\__construct
__construct(AuthFactory $auth)
Definition:
UserWebAuthentication.php:24
UserAuthentication
BristolSU\Support\User\UserWebAuthentication\$auth
$auth
Definition:
UserWebAuthentication.php:19
Generated by
1.8.13