ErrorServiceProvider.php 773 B

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