DatabaseServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Magister\Services\Database;
4
5
use Magister\Services\Database\Elegant\Model;
6
use Magister\Services\Support\ServiceProvider;
7
8
/**
9
 * Class DatabaseServiceProvider.
10
 */
11
class DatabaseServiceProvider extends ServiceProvider
12
{
13
    /**
14
     * Register bindings in the container.
15
     *
16
     * @return void
17
     */
18
    public function register()
19
    {
20
        $this->app->singleton('db', function ($app) {
21
            return new DatabaseManager($app);
22
        });
23
    }
24
25
    /**
26
     * Perform booting of services.
27
     *
28
     * @return void
29
     */
30
    public function boot()
31
    {
32
        Model::setConnectionResolver($this->app['db']);
33
    }
34
}
35