ErrorServiceProvider.php 790 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php namespace Providers;
  2. use Illuminate\Support\ServiceProvider;
  3. class ErrorServiceProvider extends ServiceProvider {
  4. /**
  5. * Register any error handlers.
  6. *
  7. * @return void
  8. */
  9. public function boot()
  10. {
  11. // Here you may handle any errors that occur in your application, including
  12. // logging them or displaying custom views for specific errors. You may
  13. // even register several error handlers to handle different types of
  14. // exceptions. If nothing is returned, the default error view is
  15. // shown, which includes a detailed stack trace during debug.
  16. $this->app->error(function(\Exception $exception, $code)
  17. {
  18. $this->app['log']->error($exception);
  19. });
  20. }
  21. /**
  22. * Register the service provider.
  23. *
  24. * @return void
  25. */
  26. public function register()
  27. {
  28. //
  29. }
  30. }