ApiFootballServiceProvider.php 565 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace App\Providers;
  3. use App\Services\ApiFootball\Sdk;
  4. use Illuminate\Support\ServiceProvider;
  5. class ApiFootballServiceProvider extends ServiceProvider
  6. {
  7. /**
  8. * Register services.
  9. */
  10. public function register(): void
  11. {
  12. // $this->app->singleton(Sdk::class, function ($app) {
  13. // return new Sdk();
  14. // });
  15. // 或者使用别名
  16. $this->app->alias(Sdk::class, 'api-football');
  17. }
  18. /**
  19. * Bootstrap services.
  20. */
  21. public function boot(): void
  22. {
  23. //
  24. }
  25. }