Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | public function handle($request, Closure $next) |
||
19 | { |
||
20 | \URL::defaults(['subdomain' => request('subdomain')]); |
||
21 | |||
22 | $association = $request->route('association'); |
||
23 | |||
24 | if (!($association instanceof Association)) { |
||
25 | // FIXME: redo routes so we always get association from there instead: |
||
26 | $subdomain = Arr::first(explode('.', $request->getHost())); |
||
27 | |||
28 | $association = Association::where('subdomain', $subdomain)->first(); |
||
29 | } |
||
30 | |||
31 | \View::share('association', $association); |
||
32 | |||
33 | return $next($request); |
||
34 | } |
||
36 |