1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Jumilla\Versionia\Laravel; |
4
|
|
|
|
5
|
|
|
use Illuminate\Support\ServiceProvider as BaseServiceProvider; |
6
|
|
|
|
7
|
|
|
class ServiceProvider extends BaseServiceProvider |
8
|
|
|
{ |
9
|
|
|
/** |
10
|
|
|
* Register the service provider. |
11
|
|
|
*/ |
12
|
|
|
public function register() |
13
|
|
|
{ |
14
|
1 |
|
$this->app->singleton('database.migrator', function ($app) { |
15
|
1 |
|
return new Migrator($app['db'], $app['config']); |
16
|
1 |
|
}); |
17
|
1 |
|
$this->app->alias('database.migrator', Migrator::class); |
18
|
|
|
|
19
|
1 |
|
$this->registerCommands(); |
20
|
1 |
|
} |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* Register the cache related console commands. |
24
|
|
|
*/ |
25
|
|
|
public function registerCommands() |
26
|
|
|
{ |
27
|
1 |
|
$this->app->singleton('command.database.status', function ($app) { |
28
|
1 |
|
return new Commands\DatabaseStatusCommand(); |
29
|
1 |
|
}); |
30
|
|
|
|
31
|
1 |
|
$this->app->singleton('command.database.upgrade', function ($app) { |
32
|
1 |
|
return new Commands\DatabaseUpgradeCommand(); |
33
|
1 |
|
}); |
34
|
|
|
|
35
|
1 |
|
$this->app->singleton('command.database.clean', function ($app) { |
36
|
1 |
|
return new Commands\DatabaseCleanCommand(); |
37
|
1 |
|
}); |
38
|
|
|
|
39
|
1 |
|
$this->app->singleton('command.database.refresh', function ($app) { |
40
|
1 |
|
return new Commands\DatabaseRefreshCommand(); |
41
|
1 |
|
}); |
42
|
|
|
|
43
|
1 |
|
$this->app->singleton('command.database.rollback', function ($app) { |
44
|
1 |
|
return new Commands\DatabaseRollbackCommand(); |
45
|
1 |
|
}); |
46
|
|
|
|
47
|
1 |
|
$this->app->singleton('command.database.again', function ($app) { |
48
|
1 |
|
return new Commands\DatabaseAgainCommand(); |
49
|
1 |
|
}); |
50
|
|
|
|
51
|
1 |
|
$this->app->singleton('command.database.seed', function ($app) { |
52
|
1 |
|
return new Commands\DatabaseSeedCommand(); |
53
|
1 |
|
}); |
54
|
|
|
|
55
|
1 |
|
$this->app->singleton('command.migration.make', function ($app) { |
56
|
1 |
|
return new Commands\MigrationMakeCommand(); |
57
|
1 |
|
}); |
58
|
|
|
|
59
|
1 |
|
$this->app->singleton('command.seeder.make', function ($app) { |
60
|
1 |
|
return new Commands\SeederMakeCommand(); |
61
|
1 |
|
}); |
62
|
|
|
|
63
|
|
|
$this->commands([ |
64
|
|
|
'command.database.status', |
65
|
|
|
'command.database.upgrade', |
66
|
|
|
'command.database.clean', |
67
|
|
|
'command.database.refresh', |
68
|
|
|
'command.database.rollback', |
69
|
|
|
'command.database.again', |
70
|
|
|
'command.database.seed', |
71
|
|
|
'command.migration.make', |
72
|
|
|
'command.seeder.make', |
73
|
|
|
]); |
74
|
|
|
} |
75
|
|
|
} |
76
|
|
|
|