1 | <?php |
||
11 | class Generator |
||
12 | { |
||
13 | protected $amount = 1; |
||
14 | protected $uses = 1; |
||
15 | protected $email = null; |
||
16 | protected $expiry; |
||
17 | |||
18 | /** |
||
19 | * @var \Clarkeash\Doorman\DoormanManager |
||
20 | */ |
||
21 | protected $manager; |
||
22 | |||
23 | /** |
||
24 | * @var BaseInvite |
||
25 | */ |
||
26 | protected $invite; |
||
27 | |||
28 | 17 | public function __construct(DoormanManager $manager, BaseInvite $invite) |
|
33 | |||
34 | /** |
||
35 | * @param int $amount |
||
36 | * |
||
37 | * @return $this |
||
38 | */ |
||
39 | 2 | public function times(int $amount = 1) |
|
45 | |||
46 | /** |
||
47 | * @param int $amount |
||
48 | * |
||
49 | * @return $this |
||
50 | */ |
||
51 | 2 | public function uses(int $amount = 1) |
|
57 | |||
58 | /** |
||
59 | * @return $this |
||
60 | */ |
||
61 | 1 | public function unlimited() |
|
65 | |||
66 | /** |
||
67 | * @param string $email |
||
68 | * |
||
69 | * @return $this |
||
70 | * @throws \Clarkeash\Doorman\Exceptions\DuplicateException |
||
71 | */ |
||
72 | 3 | public function for(string $email) |
|
82 | |||
83 | /** |
||
84 | * @param DateTimeInterface $date |
||
85 | * |
||
86 | * @return $this |
||
87 | */ |
||
88 | 4 | public function expiresOn(DateTimeInterface $date) |
|
94 | |||
95 | /** |
||
96 | * @param int $days |
||
97 | * |
||
98 | * @return $this |
||
99 | */ |
||
100 | 1 | public function expiresIn($days = 14) |
|
106 | |||
107 | /** |
||
108 | * @return \Clarkeash\Doorman\Models\BaseInvite |
||
109 | * @throws \Illuminate\Contracts\Container\BindingResolutionException |
||
110 | */ |
||
111 | 15 | protected function build(): BaseInvite |
|
121 | |||
122 | /** |
||
123 | * @return \Illuminate\Support\Collection |
||
124 | * @throws DuplicateException |
||
125 | * @throws \Illuminate\Contracts\Container\BindingResolutionException |
||
126 | */ |
||
127 | 14 | public function make() |
|
145 | |||
146 | /** |
||
147 | * @return BaseInvite |
||
148 | * @throws \Illuminate\Contracts\Container\BindingResolutionException |
||
149 | */ |
||
150 | 2 | public function once(): BaseInvite |
|
154 | } |
||
155 |