ApiDocGeneratorServiceProvider.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace Mpociot\ApiDoc;
  3. use Illuminate\Support\ServiceProvider;
  4. use Mpociot\ApiDoc\Commands\RebuildDocumentation;
  5. use Mpociot\ApiDoc\Commands\GenerateDocumentation;
  6. class ApiDocGeneratorServiceProvider extends ServiceProvider
  7. {
  8. /**
  9. * Bootstrap the application events.
  10. *
  11. * @return void
  12. */
  13. public function boot()
  14. {
  15. $this->loadViewsFrom(__DIR__.'/../resources/views/', 'apidoc');
  16. $this->publishes([
  17. __DIR__.'/../resources/views' => app()->basePath().'/resources/views/vendor/apidoc',
  18. ], 'apidoc-views');
  19. $this->publishes([
  20. __DIR__.'/../config/apidoc.php' => app()->basePath().'/config/apidoc.php',
  21. ], 'apidoc-config');
  22. $this->mergeConfigFrom(__DIR__.'/../config/apidoc.php', 'apidoc');
  23. if ($this->app->runningInConsole()) {
  24. $this->commands([
  25. GenerateDocumentation::class,
  26. RebuildDocumentation::class,
  27. ]);
  28. }
  29. }
  30. /**
  31. * Register the API doc commands.
  32. *
  33. * @return void
  34. */
  35. public function register()
  36. {
  37. //
  38. }
  39. }