Skip to content

Commit

Permalink
#19 feat: create command to check all providers
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhongit committed Jul 28, 2024
1 parent 2c1d995 commit d98542b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions src/Commands/ListProviders.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace CSlant\Blog\Core\Commands;

use Illuminate\Console\Command;
use Illuminate\Support\Facades\App;

class ListProviders extends Command
{
protected $signature = 'providers:list';
protected $description = 'List all registered service providers';

public function handle()

Check failure on line 13 in src/Commands/ListProviders.php

View workflow job for this annotation

GitHub Actions / PHPStan - P8.1

Method CSlant\Blog\Core\Commands\ListProviders::handle() has no return type specified.

Check failure on line 13 in src/Commands/ListProviders.php

View workflow job for this annotation

GitHub Actions / PHPStan - P8.2

Method CSlant\Blog\Core\Commands\ListProviders::handle() has no return type specified.

Check failure on line 13 in src/Commands/ListProviders.php

View workflow job for this annotation

GitHub Actions / PHPStan - P8.1

Method CSlant\Blog\Core\Commands\ListProviders::handle() has no return type specified.

Check failure on line 13 in src/Commands/ListProviders.php

View workflow job for this annotation

GitHub Actions / PHPStan - P8.3

Method CSlant\Blog\Core\Commands\ListProviders::handle() has no return type specified.
{
$providers = App::getLoadedProviders();

foreach ($providers as $provider => $loaded) {
if ($loaded) {
$this->info($provider);
}
}
}
}
2 changes: 1 addition & 1 deletion src/Providers/BlogCoreServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function provides(): ?array
protected function registerCommands(): void
{
$this->commands([
//
\CSlant\Blog\Core\Commands\ListProviders::class,
]);
}

Expand Down

0 comments on commit d98542b

Please sign in to comment.