ServiceProvider.tpl 572 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace App\{module}\Providers;
  3. use App\Base\Providers\AppServiceProvider;
  4. use App\{module}\Services\{action}Service;
  5. use App\{module}\Models\{action}Model;
  6. use App\{module}\Facades\{action}Facade;
  7. class {action}ServiceProvider extends AppServiceProvider
  8. {
  9. public function register()
  10. {
  11. $this->app->bind({action}Service::class,function(){
  12. return new {action}Service(new {action}Model);
  13. });
  14. $this->app->bind({action}Facade::class,function(){
  15. return app()->make({action}Service::class);
  16. });
  17. }
  18. }