service-provider.stub 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace :namespace;
  3. use Illuminate\Support\ServiceProvider;
  4. class :class_nameServiceProvider extends ServiceProvider
  5. {
  6. /**
  7. * {@inheritdoc}
  8. */
  9. public function boot()
  10. {
  11. $extension = :class_name::make();
  12. if ($views = $extension->views()) {
  13. $this->loadViewsFrom($views, :class_name::NAME);
  14. }
  15. if ($lang = $extension->lang()) {
  16. $this->loadTranslationsFrom($lang, :class_name::NAME);
  17. }
  18. if ($migrations = $extension->migrations()) {
  19. $this->loadMigrationsFrom($migrations);
  20. }
  21. $this->app->booted(function () use ($extension) {
  22. $extension->routes(__DIR__.'/../routes/web.php');
  23. });
  24. // if ($this->app->runningInConsole() || request()->getMethod() == 'POST') {
  25. // $this->publishes([__DIR__.'/../config' => config_path()]);
  26. // }
  27. }
  28. /**
  29. * Register the service provider.
  30. *
  31. * @return void
  32. */
  33. public function register()
  34. {
  35. }
  36. }