global.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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().'/console',
  14. app_path().'/controllers',
  15. app_path().'/models',
  16. app_path().'/database/seeds',
  17. ));
  18. /*
  19. |--------------------------------------------------------------------------
  20. | Application Error Logger
  21. |--------------------------------------------------------------------------
  22. |
  23. | Here we will configure the error logger setup for the application which
  24. | is built on top of the wonderful Monolog library. By default we will
  25. | build a basic log file setup which creates a single file for logs.
  26. |
  27. */
  28. Log::useFiles(storage_path().'/logs/laravel.log');
  29. /*
  30. |--------------------------------------------------------------------------
  31. | Application Error Handler
  32. |--------------------------------------------------------------------------
  33. |
  34. | Here you may handle any errors that occur in your application, including
  35. | logging them or displaying custom views for specific errors. You may
  36. | even register several error handlers to handle different types of
  37. | exceptions. If nothing is returned, the default error view is
  38. | shown, which includes a detailed stack trace during debug.
  39. |
  40. */
  41. App::error(function(Exception $exception, $code)
  42. {
  43. Log::error($exception);
  44. });
  45. /*
  46. |--------------------------------------------------------------------------
  47. | Maintenance Mode Handler
  48. |--------------------------------------------------------------------------
  49. |
  50. | The "down" Artisan command gives you the ability to put an application
  51. | into maintenance mode. Here, you will define what is displayed back
  52. | to the user if maintenance mode is in effect for the application.
  53. |
  54. */
  55. App::down(function()
  56. {
  57. return Response::make("Be right back!", 503);
  58. });
  59. /*
  60. |--------------------------------------------------------------------------
  61. | Require The Filters File
  62. |--------------------------------------------------------------------------
  63. |
  64. | Next we will load the filters file for the application. This gives us
  65. | a nice separate location to store our route and application filter
  66. | definitions instead of putting them all in the main routes file.
  67. |
  68. */
  69. require app_path().'/filters.php';