1 | <?php |
||
8 | class MultilingualRoutePendingRegistration |
||
9 | { |
||
10 | /** |
||
11 | * The handle of the routes. |
||
12 | * |
||
13 | * @var mixed |
||
14 | */ |
||
15 | protected $handle; |
||
16 | |||
17 | /** |
||
18 | * The translation key of the routes. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $key; |
||
23 | |||
24 | /** |
||
25 | * The list of locales for the route. |
||
26 | * |
||
27 | * @var array |
||
28 | */ |
||
29 | protected $locales = []; |
||
30 | |||
31 | /** |
||
32 | * The options of the routes. |
||
33 | * |
||
34 | * @var array |
||
35 | */ |
||
36 | protected $options = []; |
||
37 | |||
38 | /** |
||
39 | * The resource's registration status. |
||
40 | * |
||
41 | * @var bool |
||
42 | */ |
||
43 | protected $registered = false; |
||
44 | |||
45 | /** |
||
46 | * The resource registrar. |
||
47 | * |
||
48 | * @var \ChinLeung\MultilingualRoutes\MultilingualRegistrar |
||
49 | */ |
||
50 | protected $registrar; |
||
51 | |||
52 | /** |
||
53 | * Constructor of the class. |
||
54 | * |
||
55 | * @param \ChinLeung\MultilingualRoutes\MultilingualRegistrar $registrar |
||
56 | * @param string $key |
||
57 | * @param mixed $handle |
||
58 | * @param array $locales |
||
59 | */ |
||
60 | public function __construct(MultilingualRegistrar $registrar, string $key, $handle, array $locales = []) |
||
67 | |||
68 | /** |
||
69 | * Register the resource route. |
||
70 | * |
||
71 | * @return \Illuminate\Routing\RouteCollection |
||
72 | */ |
||
73 | public function register(): RouteCollection |
||
84 | |||
85 | /** |
||
86 | * Add one or many locale to the exception. |
||
87 | * |
||
88 | * @param string|array $locales |
||
89 | * @return self |
||
90 | */ |
||
91 | public function except($locales): self |
||
100 | |||
101 | /** |
||
102 | * Set the name of the routes. |
||
103 | * |
||
104 | * @param string $name |
||
105 | * @return self |
||
106 | */ |
||
107 | public function name(string $name): self |
||
113 | |||
114 | /** |
||
115 | * Set the method of the routes. |
||
116 | * |
||
117 | * @param string $method |
||
118 | * @return self |
||
119 | */ |
||
120 | public function method(string $method): self |
||
126 | |||
127 | /** |
||
128 | * Set the name of each locale for the routes. |
||
129 | * |
||
130 | * @param array $names |
||
131 | * @return self |
||
132 | */ |
||
133 | public function names(array $names): self |
||
139 | |||
140 | /** |
||
141 | * Set the route for a list of locales only. |
||
142 | * |
||
143 | * @param string|array $locales |
||
144 | * @return self |
||
145 | */ |
||
146 | public function only($locales): self |
||
155 | |||
156 | /** |
||
157 | * Set a regular expression requirement on the route. |
||
158 | * |
||
159 | * @param array|string $name |
||
160 | * @param string|null $expression |
||
161 | * @return $this |
||
162 | */ |
||
163 | public function where($name, $expression = null): self |
||
173 | |||
174 | /** |
||
175 | * Set the view to render. |
||
176 | * |
||
177 | * @param string $view |
||
178 | * @return self |
||
179 | */ |
||
180 | public function view(string $view): self |
||
186 | |||
187 | /** |
||
188 | * Set default parameters values of the routes. |
||
189 | * |
||
190 | * @param array $defaults |
||
191 | * @return self |
||
192 | */ |
||
193 | public function defaults(array $defaults): self |
||
199 | |||
200 | /** |
||
201 | * Handle the object's destruction. |
||
202 | * |
||
203 | * @return void |
||
204 | */ |
||
205 | public function __destruct() |
||
211 | } |
||
212 |