2018-01-16 21:26:59 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Engelsystem\Database\Migration;
|
|
|
|
|
|
|
|
use Engelsystem\Container\ServiceProvider;
|
2018-09-16 00:58:25 +02:00
|
|
|
use Engelsystem\Database\Database;
|
2018-01-16 21:26:59 +01:00
|
|
|
use Illuminate\Database\Schema\Builder as SchemaBuilder;
|
|
|
|
|
|
|
|
class MigrationServiceProvider extends ServiceProvider
|
|
|
|
{
|
|
|
|
public function register()
|
|
|
|
{
|
2018-09-16 00:58:25 +02:00
|
|
|
/** @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');
|
2018-01-16 21:26:59 +01:00
|
|
|
|
|
|
|
$migration = $this->app->make(Migrate::class);
|
|
|
|
$this->app->instance('db.migration', $migration);
|
|
|
|
}
|
|
|
|
}
|