1 | <?php |
||
15 | class FormsServiceProvider extends ServiceProvider |
||
16 | { |
||
17 | use ConsoleTools; |
||
18 | |||
19 | /** |
||
20 | * The commands to be registered. |
||
21 | * |
||
22 | * @var array |
||
23 | */ |
||
24 | protected $commands = [ |
||
25 | MigrateCommand::class => 'command.rinvex.forms.migrate', |
||
26 | PublishCommand::class => 'command.rinvex.forms.publish', |
||
27 | RollbackCommand::class => 'command.rinvex.forms.rollback', |
||
28 | ]; |
||
29 | |||
30 | /** |
||
31 | * {@inheritdoc} |
||
32 | */ |
||
33 | public function register() |
||
34 | { |
||
35 | // Merge config |
||
36 | $this->mergeConfigFrom(realpath(__DIR__.'/../../config/config.php'), 'rinvex.forms'); |
||
37 | |||
38 | // Bind eloquent models to IoC container |
||
39 | $this->app->singleton('rinvex.forms.form', $formModel = $this->app['config']['rinvex.forms.models.form']); |
||
40 | $formModel === Form::class || $this->app->alias('rinvex.forms.form', Form::class); |
||
41 | |||
42 | $this->app->singleton('rinvex.forms.form_response', $formModel = $this->app['config']['rinvex.forms.models.form_response']); |
||
43 | $formModel === FormResponse::class || $this->app->alias('rinvex.forms.form_response', FormResponse::class); |
||
44 | |||
45 | // Register console commands |
||
46 | $this->registerCommands($this->commands); |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * {@inheritdoc} |
||
51 | */ |
||
52 | public function boot() |
||
59 | } |
||
60 |