Issues (17)

src/IdeHelperServiceProvider.php (1 issue)

1
<?php
2
3
namespace Staudenmeir\BelongsToThrough;
4
5
use Barryvdh\LaravelIdeHelper\Console\ModelsCommand;
6
use Illuminate\Contracts\Support\DeferrableProvider;
7
use Illuminate\Support\ServiceProvider;
8
use Staudenmeir\BelongsToThrough\IdeHelper\BelongsToThroughRelationsHook;
9
10
class IdeHelperServiceProvider extends ServiceProvider implements DeferrableProvider
11
{
12
    public function register(): void
13
    {
14
        /** @var \Illuminate\Contracts\Config\Repository $config */
15
        $config = $this->app->get('config');
16
17
        $config->set(
18
            'ide-helper.model_hooks',
19
            array_merge(
20
                [BelongsToThroughRelationsHook::class],
21
                $config->array('ide-helper.model_hooks', [])
22
            )
23
        );
24
    }
25
26
    /**
27
     * @return class-string<\Illuminate\Console\Command>[]
0 ignored issues
show
Documentation Bug introduced by
The doc comment class-string<\Illuminate\Console\Command>[] at position 0 could not be parsed: Unknown type name 'class-string' at position 0 in class-string<\Illuminate\Console\Command>[].
Loading history...
28
     */
29
    public function provides(): array
30
    {
31
        return [
32
            ModelsCommand::class,
33
        ];
34
    }
35
}
36