1 | <?php |
||
7 | class AuthyMessage |
||
8 | { |
||
9 | /** |
||
10 | * The notification method (sms/call). |
||
11 | * |
||
12 | * @var string |
||
13 | */ |
||
14 | public $method = 'sms'; |
||
15 | |||
16 | /** |
||
17 | * Determine whether to force the notification over cellphone network. |
||
18 | * |
||
19 | * @var bool |
||
20 | */ |
||
21 | public $force = false; |
||
22 | |||
23 | /** |
||
24 | * The notification message action. |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | public $action; |
||
29 | |||
30 | /** |
||
31 | * The notification message action message. |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | public $actionMessage; |
||
36 | |||
37 | /** |
||
38 | * Create a new Authy message instance. |
||
39 | * |
||
40 | * @return static |
||
41 | */ |
||
42 | public static function create() |
||
43 | { |
||
44 | return new static(); |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * Set the method of the Authy message. |
||
49 | * |
||
50 | * @param string $method |
||
51 | * |
||
52 | * @return $this |
||
53 | */ |
||
54 | public function method($method) |
||
55 | { |
||
56 | $this->method = $method === 'call' ? 'call' : 'sms'; |
||
57 | |||
58 | return $this; |
||
59 | } |
||
60 | |||
61 | /** |
||
62 | * Indicate that the notification is forced over cellphone network. |
||
63 | * |
||
64 | * @return $this |
||
65 | */ |
||
66 | public function force() |
||
67 | { |
||
68 | $this->force = true; |
||
69 | |||
70 | return $this; |
||
71 | } |
||
72 | |||
73 | /** |
||
74 | * Set the notification action. |
||
75 | * |
||
76 | * @param string $action |
||
77 | * |
||
78 | * @return $this |
||
79 | */ |
||
80 | public function action($action) |
||
86 | |||
87 | /** |
||
88 | * Set the notification action message. |
||
89 | * |
||
90 | * @param string $actionMessage |
||
91 | * |
||
92 | * @return $this |
||
93 | */ |
||
94 | public function actionMessage($actionMessage) |
||
100 | } |
||
101 |