1 | <?php namespace Arcanedev\Localization\Routing; |
||
12 | class Router extends IlluminateRouter |
||
13 | { |
||
14 | /* ------------------------------------------------------------------------------------------------ |
||
15 | | Getters & Setters |
||
16 | | ------------------------------------------------------------------------------------------------ |
||
17 | */ |
||
18 | /** |
||
19 | * Get active middlewares. |
||
20 | * |
||
21 | * @return array |
||
22 | */ |
||
23 | 192 | protected function getActiveMiddlewares() |
|
29 | |||
30 | /* ------------------------------------------------------------------------------------------------ |
||
31 | | Route Functions |
||
32 | | ------------------------------------------------------------------------------------------------ |
||
33 | */ |
||
34 | /** |
||
35 | * Create a route group with shared attributes. |
||
36 | * |
||
37 | * @param array $attributes |
||
38 | * @param \Closure $callback |
||
39 | */ |
||
40 | 192 | public function localizedGroup(Closure $callback, $attributes = []) |
|
49 | |||
50 | /** |
||
51 | * Register a new translated GET route with the router. |
||
52 | * |
||
53 | * @param string $trans |
||
54 | * @param \Closure|array|string $action |
||
55 | * |
||
56 | * @return \Illuminate\Routing\Route |
||
57 | */ |
||
58 | 192 | public function transGet($trans, $action) |
|
64 | |||
65 | /** |
||
66 | * Register a new translated POST route with the router. |
||
67 | * |
||
68 | * @param string $trans |
||
69 | * @param \Closure|array|string $action |
||
70 | * |
||
71 | * @return \Illuminate\Routing\Route |
||
72 | */ |
||
73 | 192 | public function transPost($trans, $action) |
|
79 | |||
80 | /** |
||
81 | * Register a new translated PUT route with the router. |
||
82 | * |
||
83 | * @param string $trans |
||
84 | * @param \Closure|array|string $action |
||
85 | * |
||
86 | * @return \Illuminate\Routing\Route |
||
87 | */ |
||
88 | 192 | public function transPut($trans, $action) |
|
94 | |||
95 | /** |
||
96 | * Register a new translated PATCH route with the router. |
||
97 | * |
||
98 | * @param string $trans |
||
99 | * @param \Closure|array|string $action |
||
100 | * |
||
101 | * @return \Illuminate\Routing\Route |
||
102 | */ |
||
103 | 192 | public function transPatch($trans, $action) |
|
109 | |||
110 | /** |
||
111 | * Register a new translated DELETE route with the router. |
||
112 | * |
||
113 | * @param string $trans |
||
114 | * @param \Closure|array|string $action |
||
115 | * |
||
116 | * @return \Illuminate\Routing\Route |
||
117 | */ |
||
118 | 192 | public function transDelete($trans, $action) |
|
124 | |||
125 | /** |
||
126 | * Register a new translated OPTIONS route with the router. |
||
127 | * |
||
128 | * @param string $trans |
||
129 | * @param \Closure|array|string $action |
||
130 | * |
||
131 | * @return \Illuminate\Routing\Route |
||
132 | */ |
||
133 | 192 | public function transOptions($trans, $action) |
|
139 | |||
140 | /** |
||
141 | * Register a new translated any route with the router. |
||
142 | * |
||
143 | * @param string $trans |
||
144 | * @param \Closure|array|string $action |
||
145 | * |
||
146 | * @return \Illuminate\Routing\Route |
||
147 | */ |
||
148 | 192 | public function transAny($trans, $action) |
|
154 | |||
155 | /* ----------------------------------------------------------------- |
||
156 | | Other Methods |
||
157 | | ----------------------------------------------------------------- |
||
158 | */ |
||
159 | /** |
||
160 | * Translate the route. |
||
161 | * |
||
162 | * @param string $key |
||
163 | * |
||
164 | * @return string |
||
165 | */ |
||
166 | 192 | private function transRoute($key) |
|
170 | } |
||
171 |