GridServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 43
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 4 1
A register() 0 8 1
A provides() 0 4 1
1
<?php
2
3
namespace Boduch\Grid;
4
5
use Boduch\Grid\Console\GridMakeCommand;
6
use Boduch\Grid\GridBuilder;
7
use Illuminate\Support\ServiceProvider;
8
9
class GridServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Indicates if loading of the provider is deferred.
13
     *
14
     * @var bool
15
     */
16
    protected $defer = true;
17
18
    /**
19
     * Bootstrap the application services.
20
     *
21
     * @return void
22
     */
23
    public function boot()
24
    {
25
        $this->loadViewsFrom(__DIR__ . '/resources/views', 'laravel-grid');
26
    }
27
28
    /**
29
     * Register the application services.
30
     *
31
     * @return void
32
     */
33
    public function register()
34
    {
35
        $this->commands(GridMakeCommand::class);
36
37
        $this->app->singleton('grid.builder', function ($app) {
38
            return new GridBuilder($app);
39
        });
40
    }
41
42
    /**
43
     * Get the services provided by the provider.
44
     *
45
     * @return array
46
     */
47
    public function provides()
48
    {
49
        return ['grid.builder', GridBuilder::class];
50
    }
51
}
52