1 | <?php |
||
10 | class Generator |
||
11 | { |
||
12 | protected $amount = 1; |
||
13 | protected $uses = 1; |
||
14 | protected $email = null; |
||
15 | protected $expiry; |
||
16 | |||
17 | /** |
||
18 | * @var \Clarkeash\Doorman\DoormanManager |
||
19 | */ |
||
20 | protected $manager; |
||
21 | |||
22 | /** |
||
23 | * @var BaseInvite |
||
24 | */ |
||
25 | protected $invite; |
||
26 | |||
27 | 16 | public function __construct(DoormanManager $manager, BaseInvite $invite) |
|
32 | |||
33 | /** |
||
34 | * @param int $amount |
||
35 | * |
||
36 | * @return $this |
||
37 | */ |
||
38 | 2 | public function times(int $amount = 1) |
|
44 | |||
45 | /** |
||
46 | * @param int $amount |
||
47 | * |
||
48 | * @return $this |
||
49 | */ |
||
50 | 1 | public function uses(int $amount = 1) |
|
56 | |||
57 | /** |
||
58 | * @param string $email |
||
59 | * |
||
60 | * @return $this |
||
61 | * @throws \Clarkeash\Doorman\Exceptions\DuplicateException |
||
62 | */ |
||
63 | 3 | public function for(string $email) |
|
73 | |||
74 | /** |
||
75 | * @param \DateTimeInterface $date |
||
76 | * |
||
77 | * @return $this |
||
78 | */ |
||
79 | 4 | public function expiresOn(\DateTimeInterface $date) |
|
85 | |||
86 | /** |
||
87 | * @param int $days |
||
88 | * |
||
89 | * @return $this |
||
90 | */ |
||
91 | 1 | public function expiresIn($days = 14) |
|
97 | |||
98 | /** |
||
99 | * @return \Clarkeash\Doorman\Models\BaseInvite |
||
100 | * @throws \Illuminate\Contracts\Container\BindingResolutionException |
||
101 | */ |
||
102 | 14 | protected function build(): BaseInvite |
|
112 | |||
113 | /** |
||
114 | * @return \Illuminate\Support\Collection |
||
115 | * @throws DuplicateException |
||
116 | * @throws \Illuminate\Contracts\Container\BindingResolutionException |
||
117 | */ |
||
118 | 14 | public function make() |
|
136 | |||
137 | /** |
||
138 | * @return BaseInvite |
||
139 | * @throws \Illuminate\Contracts\Container\BindingResolutionException |
||
140 | */ |
||
141 | 1 | public function once(): BaseInvite |
|
145 | } |
||
146 |