Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
MigrationServiceProvider
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 register
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace Engelsystem\Database\Migration;
6
7use Engelsystem\Container\ServiceProvider;
8use Engelsystem\Database\Database;
9use Illuminate\Database\Schema\Builder as SchemaBuilder;
10
11class MigrationServiceProvider extends ServiceProvider
12{
13    public function register(): void
14    {
15        /** @var Database $database */
16        $database = $this->app->get(Database::class);
17        $schema = $database->getConnection()->getSchemaBuilder();
18
19        $this->app->instance('db.schema', $schema);
20        $this->app->bind(SchemaBuilder::class, 'db.schema');
21
22        $migration = $this->app->make(Migrate::class);
23        $this->app->instance('db.migration', $migration);
24    }
25}