ApiServiceProvider.php 643 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: fangx
  5. * Date: 2021/7/23
  6. * Time: 9:42
  7. */
  8. namespace App\Api\Providers;
  9. use App\Api\Facades\ApiFacade;
  10. use App\Api\Services\ApiService;
  11. use App\Base\Providers\AppServiceProvider;
  12. class ApiServiceProvider extends AppServiceProvider
  13. {
  14. public function boot()
  15. {
  16. parent::boot();
  17. }
  18. /**
  19. * 注册绑定门面
  20. */
  21. public function register()
  22. {
  23. //注册Api
  24. $this->registerApi();
  25. }
  26. public function registerApi(){
  27. $this->app->bind(ApiFacade::class, function () {
  28. return app()->make(ApiService::class);
  29. });
  30. }
  31. }