Completed
Push — master ( 70e463...bc8ad7 )
by Sam
04:16
created

DomainServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 6 1
A register() 0 2 1
1
<?php
2
3
namespace App\Providers;
4
5
use Illuminate\Support\Facades\View;
6
use Illuminate\Support\ServiceProvider;
7
8
class DomainServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Register services.
12
     *
13
     * @return void
14
     */
15
    public function register()
16
    {
17
        //
18
    }
19
20
    /**
21
     * Bootstrap services.
22
     *
23
     * @return void
24
     */
25
    public function boot()
26
    {
27
        // FIXME: redo routes so we always get association from there instead:
28
        $subdomain = array_first(explode('.', request()->getHost()));
0 ignored issues
show
Deprecated Code introduced by
The function array_first() has been deprecated: Arr::first() should be used directly instead. Will be removed in Laravel 5.9. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

28
        $subdomain = /** @scrutinizer ignore-deprecated */ array_first(explode('.', request()->getHost()));

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
29
30
        View::share('subdomain', $subdomain);
31
    }
32
}
33