Total Complexity | 6 |
Total Lines | 57 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
11 | class Locale |
||
12 | { |
||
13 | /** |
||
14 | * Constant for the session key for locale. |
||
15 | * |
||
16 | * @const string |
||
17 | */ |
||
18 | const SESSION_KEY = 'locale'; |
||
19 | |||
20 | /** |
||
21 | * Repository of languages to be used throughout the controller. |
||
22 | * |
||
23 | * @var \PWWEB\Localisation\Repositories\LanguageRepository |
||
24 | */ |
||
25 | private $languageRepository; |
||
26 | |||
27 | public function __construct(LanguageRepository $languageRepo) |
||
28 | { |
||
29 | $this->languageRepository = $languageRepo; |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * Locale middleware handler. |
||
34 | * |
||
35 | * @param Illuminate\Http\Request $request current request |
||
|
|||
36 | * @param Closure $next Next |
||
37 | * |
||
38 | * @return mixed |
||
39 | */ |
||
40 | public function handle(Request $request, Closure $next) |
||
68 | } |
||
69 | } |
||
70 |