1 | <?php |
||
21 | trait LoggedUser |
||
22 | { |
||
23 | /** |
||
24 | * @var mixed |
||
25 | */ |
||
26 | protected $loggedUser; |
||
27 | |||
28 | /** |
||
29 | * @var \Illuminate\Contracts\Auth\Factory|\Illuminate\Contracts\Auth\Guard|\Illuminate\Contracts\Auth\StatefulGuard |
||
30 | */ |
||
31 | protected $auth; |
||
32 | |||
33 | /** |
||
34 | * @param \Illuminate\Contracts\Auth\Factory|\Illuminate\Contracts\Auth\Guard|\Illuminate\Contracts\Auth\StatefulGuard $auth |
||
35 | * |
||
36 | * @return $this |
||
37 | */ |
||
38 | protected function setAuth($auth) |
||
44 | |||
45 | /** |
||
46 | * @return SessionGuard |
||
47 | */ |
||
48 | protected function getAuth() |
||
56 | |||
57 | /** |
||
58 | * Return instance of the logged user. |
||
59 | * |
||
60 | * @param mixed $user |
||
61 | * |
||
62 | * @return $this |
||
63 | */ |
||
64 | public function setLoggedUser($user) |
||
70 | |||
71 | protected function isLoggedIn() |
||
77 | |||
78 | /** |
||
79 | * Is current logged in user with role User. |
||
80 | * |
||
81 | * @return bool |
||
82 | */ |
||
83 | protected function isLoggedNormalUser() |
||
87 | |||
88 | /** |
||
89 | * Inject the instance of logged user. |
||
90 | * |
||
91 | * @return void |
||
92 | */ |
||
93 | protected function lazyLoadLoggedUser() |
||
103 | |||
104 | /** |
||
105 | * Return instance of the logged user. |
||
106 | * |
||
107 | * @return User |
||
108 | */ |
||
109 | public function getLoggedUser() |
||
120 | } |
||
121 |