|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace EmailChangeVerification; |
|
4
|
|
|
|
|
5
|
|
|
use EmailChangeVerification\Broker\BrokerInterface; |
|
6
|
|
|
use EmailChangeVerification\Token\TokenRepositoryInterface; |
|
7
|
|
|
use EmailChangeVerification\User\HasEmailChangeVerification; |
|
8
|
|
|
use Illuminate\Support\Facades\Facade; |
|
9
|
|
|
|
|
10
|
|
|
/** |
|
11
|
|
|
* @method static mixed verify( array $credentials, \Closure $callback ) |
|
12
|
|
|
* @method static string sendVerificationLink( array $credentials, string $newEmail, \Closure $callback = null ) |
|
13
|
|
|
* @method static HasEmailChangeVerification getUser( array $credentials ) |
|
14
|
|
|
* @method static string createToken( HasEmailChangeVerification $user, string $newEmail ) |
|
15
|
|
|
* @method static void deleteToken( HasEmailChangeVerification $user ) |
|
16
|
|
|
* @method static bool tokenExists( HasEmailChangeVerification $user, string $token, string $newEmail ) |
|
17
|
|
|
* @method static TokenRepositoryInterface getRepository() |
|
18
|
|
|
* @method static BrokerInterface broker( string|null $name = null ) |
|
19
|
|
|
* |
|
20
|
|
|
* @see Broker |
|
21
|
|
|
*/ |
|
22
|
|
|
class EmailChange extends Facade |
|
23
|
|
|
{ |
|
24
|
|
|
/** |
|
25
|
|
|
* Constant representing a successfully sent reminder. |
|
26
|
|
|
* |
|
27
|
|
|
* @var string |
|
28
|
|
|
*/ |
|
29
|
|
|
const VERIFICATION_LINK_SENT = BrokerInterface::VERIFICATION_LINK_SENT; |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* Constant representing a successfully email changed. |
|
33
|
|
|
* |
|
34
|
|
|
* @var string |
|
35
|
|
|
*/ |
|
36
|
|
|
const EMAIL_CHANGED = BrokerInterface::EMAIL_CHANGED; |
|
37
|
|
|
|
|
38
|
|
|
/** |
|
39
|
|
|
* Constant representing the user not found response. |
|
40
|
|
|
* |
|
41
|
|
|
* @var string |
|
42
|
|
|
*/ |
|
43
|
|
|
const INVALID_USER = BrokerInterface::INVALID_USER; |
|
44
|
|
|
|
|
45
|
|
|
/** |
|
46
|
|
|
* Constant representing an invalid token. |
|
47
|
|
|
* |
|
48
|
|
|
* @var string |
|
49
|
|
|
*/ |
|
50
|
|
|
const INVALID_TOKEN = BrokerInterface::INVALID_TOKEN; |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* Constant representing a throttled verification attempt. |
|
54
|
|
|
* |
|
55
|
|
|
* @var string |
|
56
|
|
|
*/ |
|
57
|
|
|
const EMAIL_THROTTLED = BrokerInterface::EMAIL_THROTTLED; |
|
58
|
|
|
|
|
59
|
|
|
/** |
|
60
|
|
|
* Get the registered name of the component. |
|
61
|
|
|
* |
|
62
|
|
|
* @return string |
|
63
|
|
|
*/ |
|
64
|
22 |
|
protected static function getFacadeAccessor() |
|
65
|
|
|
{ |
|
66
|
22 |
|
return 'auth.email_changes'; |
|
67
|
|
|
} |
|
68
|
|
|
} |
|
69
|
|
|
|