Completed
Branch master (a2d832)
by Timo
02:40
created

DataTablesServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace hamburgscleanest\DataTables;
4
5
use hamburgscleanest\DataTables\Facades\DataTable as DataTableFacade;
6
use hamburgscleanest\DataTables\Models\DataTable;
7
use Illuminate\Foundation\AliasLoader;
8
use Illuminate\Support\ServiceProvider;
9
10
/**
11
 * Class DataTablesServiceProvider
12
 * @package hamburgscleanest\DataTables
13
 */
14
class DataTablesServiceProvider extends ServiceProvider {
15
16
    /**
17
     * Perform post-registration booting of services.
18
     *
19
     * @return void
20
     */
21 14
    public function boot()
22
    {
23
24 14
    }
25
26
    /**
27
     * Register any package services.
28
     *
29
     * @return void
30
     */
31 14
    public function register()
32
    {
33
        $this->app->bind('datatable', function($app)
34
        {
35 10
            return new DataTable($app->request);
36 14
        });
37
38 14
        $this->app->booting(function()
39
        {
40 14
            $loader = AliasLoader::getInstance();
41 14
            $loader->alias('DataTable', DataTableFacade::class);
42 14
        });
43 14
    }
44
45
    /**
46
     * Get the services provided by the provider.
47
     *
48
     * @return array
49
     */
50
    public function provides()
51
    {
52
        return ['datatable'];
53
    }
54
}