| 1 | <?php |
||
| 10 | class RethinkdbServiceProvider extends ServiceProvider |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * Bootstrap the application events. |
||
| 14 | * |
||
| 15 | * @return void |
||
| 16 | */ |
||
| 17 | public function boot() |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Register the service provider. |
||
| 25 | * |
||
| 26 | * @return void |
||
| 27 | */ |
||
| 28 | public function register() |
||
| 29 | { |
||
| 30 | $this->app->resolving('db', function ($db) { |
||
| 31 | $db->extend('rethinkdb', function ($config) { |
||
| 32 | return new Connection($config); |
||
| 33 | }); |
||
| 34 | }); |
||
| 35 | |||
| 36 | $this->app->singleton('command.rethink-migrate.make', function ($app) { |
||
| 37 | |||
| 38 | $creator = new MigrationCreator($app['files']); |
||
| 39 | $composer = $app['composer']; |
||
| 40 | |||
| 41 | return new MigrateMakeCommand($creator, $composer); |
||
| 42 | }); |
||
| 43 | |||
| 44 | $this->commands('command.rethink-migrate.make'); |
||
| 45 | } |
||
| 46 | |||
| 47 | public function provides() |
||
| 51 | } |
||
| 52 |