Skip to content

Commit

Permalink
Use alias for deferred provider
Browse files Browse the repository at this point in the history
  • Loading branch information
staudenmeir committed Feb 2, 2025
1 parent 05a7cd3 commit c99fe1a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/IdeHelperServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

class IdeHelperServiceProvider extends ServiceProvider implements DeferrableProvider
{
/**
* @var string
*/
const ModelsCommandAlias = __NAMESPACE__ . '\\' . ModelsCommand::class;
public function register(): void
{
/** @var \Illuminate\Config\Repository $config */
Expand All @@ -21,15 +25,17 @@ public function register(): void
$config->array('ide-helper.model_hooks', [])
)
);

$this->app->alias(ModelsCommand::class, static::ModelsCommandAlias);
}

/**
* @return list<class-string<\Illuminate\Console\Command>>
* @return list<string>
*/
public function provides(): array
{
return [
ModelsCommand::class,
static::ModelsCommandAlias
];
}
}

0 comments on commit c99fe1a

Please sign in to comment.