1 | <?php namespace Arcanedev\LaravelTracker\Trackers; |
||
12 | class UserTracker extends AbstractTracker implements UserTrackerContract |
||
13 | { |
||
14 | /* ------------------------------------------------------------------------------------------------ |
||
15 | | Properties |
||
16 | | ------------------------------------------------------------------------------------------------ |
||
17 | */ |
||
18 | /** @var array */ |
||
19 | private $auths = []; |
||
20 | |||
21 | /* ------------------------------------------------------------------------------------------------ |
||
22 | | Constructor |
||
23 | | ------------------------------------------------------------------------------------------------ |
||
24 | */ |
||
25 | /** |
||
26 | * UserTracker constructor. |
||
27 | * |
||
28 | * @param \Illuminate\Contracts\Foundation\Application $app |
||
29 | */ |
||
30 | 18 | public function __construct(Application $app) |
|
36 | |||
37 | /** |
||
38 | * Grab all the authentication bindings. |
||
39 | */ |
||
40 | 18 | private function instantiateAuthentication() |
|
46 | |||
47 | /* ------------------------------------------------------------------------------------------------ |
||
48 | | Main Functions |
||
49 | | ------------------------------------------------------------------------------------------------ |
||
50 | */ |
||
51 | /** |
||
52 | * Track the current authenticated user id. |
||
53 | * |
||
54 | * @return int|null |
||
55 | */ |
||
56 | 12 | public function track() |
|
62 | |||
63 | /* ------------------------------------------------------------------------------------------------ |
||
64 | | Other Functions |
||
65 | | ------------------------------------------------------------------------------------------------ |
||
66 | */ |
||
67 | /** |
||
68 | * Check if the user is authenticated. |
||
69 | * |
||
70 | * @return bool |
||
71 | */ |
||
72 | 12 | protected function check() |
|
76 | |||
77 | /** |
||
78 | * Get the authenticated user. |
||
79 | * |
||
80 | * @return false|mixed |
||
81 | */ |
||
82 | protected function user() |
||
86 | |||
87 | /** |
||
88 | * Execute the auth method. |
||
89 | * |
||
90 | * @param string $method |
||
91 | * |
||
92 | * @return mixed|false |
||
93 | */ |
||
94 | 12 | private function executeAuthMethod($method) |
|
104 | } |
||
105 |