global.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | Register The Laravel Class Loader
  5. |--------------------------------------------------------------------------
  6. |
  7. | In addition to using Composer, you may use the Laravel class loader to
  8. | load your controllers and models. This is useful for keeping all of
  9. | your classes in the "global" namespace without Composer updating.
  10. |
  11. */
  12. ClassLoader::addDirectories(array(
  13. app_path().'/controllers',
  14. app_path().'/models',
  15. ));
  16. /*
  17. |--------------------------------------------------------------------------
  18. | Application Error Logger
  19. |--------------------------------------------------------------------------
  20. |
  21. | Here we will configure the error logger setup for the application which
  22. | is built on top of the wonderful Monolog library. By default we will
  23. | build a rotating log file setup which creates a new file each day.
  24. |
  25. */
  26. Log::useDailyFiles(__DIR__.'/../storage/logs/log.txt');
  27. /*
  28. |--------------------------------------------------------------------------
  29. | Application Error Handler
  30. |--------------------------------------------------------------------------
  31. |
  32. | Here you may handle any errors that occur in your application, including
  33. | logging them or displaying custom views for specific errors. You may
  34. | even register several error handlers to handle different types of
  35. | exceptions. If nothing is returned, the default error view is
  36. | shown, which includes a detailed stack trace during debug.
  37. |
  38. */
  39. App::error(function(Exception $exception, $code)
  40. {
  41. Log::error($exception);
  42. });
  43. /*
  44. |--------------------------------------------------------------------------
  45. | Require The Filters File
  46. |--------------------------------------------------------------------------
  47. |
  48. | Next we will load the filters file for the application. This gives us
  49. | a nice separate location to store our route and application filter
  50. | definitions instead of putting them all in the main routes file.
  51. |
  52. */
  53. require __DIR__.'/../filters.php';