Просмотр файла bootstrap/app.php

Размер файла: 1.58Kb
  1. <?php
  2.  
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Create The Application
  6. |--------------------------------------------------------------------------
  7. |
  8. | The first thing we will do is create a new Laravel application instance
  9. | which serves as the "glue" for all the components of Laravel, and is
  10. | the IoC container for the system binding all of the various parts.
  11. |
  12. */
  13. $app = new Illuminate\Foundation\Application(
  14. $_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
  15. );
  16.  
  17. /*
  18. |--------------------------------------------------------------------------
  19. | Bind Important Interfaces
  20. |--------------------------------------------------------------------------
  21. |
  22. | Next, we need to bind some important interfaces into the container so
  23. | we will be able to resolve them when needed. The kernels serve the
  24. | incoming requests to this application from both the web and CLI.
  25. |
  26. */
  27.  
  28. $app->singleton(
  29. Illuminate\Contracts\Http\Kernel::class,
  30. App\Http\Kernel::class
  31. );
  32.  
  33. $app->singleton(
  34. Illuminate\Contracts\Console\Kernel::class,
  35. App\Console\Kernel::class
  36. );
  37.  
  38. $app->singleton(
  39. Illuminate\Contracts\Debug\ExceptionHandler::class,
  40. App\Exceptions\Handler::class
  41. );
  42.  
  43. /*
  44. |--------------------------------------------------------------------------
  45. | Return The Application
  46. |--------------------------------------------------------------------------
  47. |
  48. | This script returns the application instance. The instance is given to
  49. | the calling script so we can separate the building of the instances
  50. | from the actual running of the application and sending responses.
  51. |
  52. */
  53.  
  54. return $app;