DomainServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 6
rs 10
1
<?php
2
3
namespace App\Providers;
4
5
use Illuminate\Support\Arr;
6
use Illuminate\Support\Facades\View;
7
use Illuminate\Support\ServiceProvider;
8
9
class DomainServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Register services.
13
     *
14
     * @return void
15
     */
16
    public function register()
17
    {
18
        //
19
    }
20
21
    /**
22
     * Bootstrap services.
23
     *
24
     * @return void
25
     */
26
    public function boot()
27
    {
28
        // FIXME: redo routes so we always get association from there instead:
29
        $subdomain = Arr::first(explode('.', request()->getHost()));
30
31
        View::share('subdomain', $subdomain);
32
    }
33
}
34