1 | <?php |
||
15 | class AttributesServiceProvider 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.attributes.migrate', |
||
26 | PublishCommand::class => 'command.rinvex.attributes.publish', |
||
27 | RollbackCommand::class => 'command.rinvex.attributes.rollback', |
||
28 | ]; |
||
29 | |||
30 | /** |
||
31 | * {@inheritdoc} |
||
32 | */ |
||
33 | public function register() |
||
34 | { |
||
35 | // Merge config |
||
36 | $this->mergeConfigFrom(realpath(__DIR__.'/../../config/config.php'), 'rinvex.attributes'); |
||
37 | |||
38 | // Bind eloquent models to IoC container |
||
39 | $this->app->singleton('rinvex.attributes.attribute', $attributeyModel = $this->app['config']['rinvex.attributes.models.attribute']); |
||
40 | $attributeyModel === Attribute::class || $this->app->alias('rinvex.attributes.attribute', Attribute::class); |
||
41 | |||
42 | $this->app->singleton('rinvex.attributes.attribute_entity', $attributeEntityModel = $this->app['config']['rinvex.attributes.models.attribute_entity']); |
||
43 | $attributeEntityModel === AttributeEntity::class || $this->app->alias('rinvex.attributes.attribute_entity', AttributeEntity::class); |
||
44 | |||
45 | // Register attributes entities |
||
46 | $this->app->singleton('rinvex.attributes.entities', function ($app) { |
||
|
|||
47 | return collect(); |
||
48 | }); |
||
49 | |||
50 | // Register console commands |
||
51 | $this->registerCommands($this->commands); |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | public function boot() |
||
64 | } |
||
65 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.