1 | <?php |
||
13 | class ApiTokenCookieFactory |
||
14 | { |
||
15 | /** |
||
16 | * The configuration repository implementation. |
||
17 | * |
||
18 | * @var \Illuminate\Contracts\Config\Repository |
||
19 | */ |
||
20 | protected $config; |
||
21 | |||
22 | /** |
||
23 | * The encrypter implementation. |
||
24 | * |
||
25 | * @var \Illuminate\Contracts\Encryption\Encrypter |
||
26 | */ |
||
27 | protected $encrypter; |
||
28 | |||
29 | /** |
||
30 | * Create an API token cookie factory instance. |
||
31 | * |
||
32 | * @param \Illuminate\Contracts\Config\Repository $config |
||
33 | * @param \Illuminate\Contracts\Encryption\Encrypter $encrypter |
||
34 | * |
||
35 | * @return void |
||
|
|||
36 | */ |
||
37 | public function __construct(Config $config, Encrypter $encrypter) |
||
42 | |||
43 | /** |
||
44 | * Create a new API token cookie. |
||
45 | * |
||
46 | * @param mixed $userId |
||
47 | * @param string $csrfToken |
||
48 | * |
||
49 | * @return \Symfony\Component\HttpFoundation\Cookie |
||
50 | */ |
||
51 | public function make($userId, $csrfToken) |
||
69 | |||
70 | /** |
||
71 | * Create a new JWT token for the given user ID and CSRF token. |
||
72 | * |
||
73 | * @param mixed $userId |
||
74 | * @param string $csrfToken |
||
75 | * @param \Carbon\Carbon $expiration |
||
76 | * |
||
77 | * @return string |
||
78 | */ |
||
79 | protected function createToken($userId, $csrfToken, Carbon $expiration) |
||
87 | } |
||
88 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.