You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1018 B

  1. <?php
  2. namespace App\HiLib\Providers;
  3. use Illuminate\Support\Facades\DB;
  4. use Illuminate\Support\Stringable;
  5. use Illuminate\Support\ServiceProvider;
  6. class HiLibraryServiceProvider extends ServiceProvider
  7. {
  8. /**
  9. * Register any application services.
  10. *
  11. * Within the register method, you should only bind things into the service container.
  12. *
  13. * @return void
  14. */
  15. public function register()
  16. {
  17. $this->app->singleton(
  18. \Illuminate\Contracts\Debug\ExceptionHandler::class,
  19. \App\HiLib\Exceptions\Handler::class
  20. );
  21. Stringable::macro('then', function($callback) {
  22. return new Stringable($callback($this));
  23. });
  24. }
  25. /**
  26. * Bootstrap any application services.
  27. *
  28. * @return void
  29. */
  30. public function boot()
  31. {
  32. DB::enableQueryLog();
  33. }
  34. /**
  35. * Get the services provided by the provider.
  36. *
  37. * @return array
  38. */
  39. public function provides()
  40. {
  41. //
  42. }
  43. }