summaryrefslogtreecommitdiff
path: root/src/Database/Migration/MigrationServiceProvider.php
blob: 310b211436995758f6782399b5788918a2ff286a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php

namespace Engelsystem\Database\Migration;

use Engelsystem\Container\ServiceProvider;
use Engelsystem\Database\Database;
use Illuminate\Database\Schema\Builder as SchemaBuilder;

class MigrationServiceProvider extends ServiceProvider
{
    public function register()
    {
        /** @var Database $database */
        $database = $this->app->get(Database::class);
        $schema = $database->getConnection()->getSchemaBuilder();

        $this->app->instance('db.schema', $schema);
        $this->app->bind(SchemaBuilder::class, 'db.schema');

        $migration = $this->app->make(Migrate::class);
        $this->app->instance('db.migration', $migration);
    }
}