app.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | Create The Application
  5. |--------------------------------------------------------------------------
  6. |
  7. | The first thing we will do is create a new Laravel application instance
  8. | which serves as the "glue" for all the components of Laravel, and is
  9. | the IoC container for the system binding all of the various parts.
  10. |
  11. */
  12. $app = new Illuminate\Foundation\Application(
  13. realpath(__DIR__.'/..')
  14. );
  15. /*
  16. |--------------------------------------------------------------------------
  17. | Create The Application
  18. |--------------------------------------------------------------------------
  19. |
  20. | The first thing we will do is create a new Laravel application instance
  21. | which serves as the "glue" for all the components of Laravel, and is
  22. | the IoC container for the system binding all of the various parts.
  23. |
  24. */
  25. $app->singleton(
  26. 'Illuminate\Contracts\Http\Kernel',
  27. 'App\Http\Kernel'
  28. );
  29. $app->singleton(
  30. 'Illuminate\Contracts\Console\Kernel',
  31. 'App\Console\Kernel'
  32. );
  33. /*
  34. |--------------------------------------------------------------------------
  35. | Return The Application
  36. |--------------------------------------------------------------------------
  37. |
  38. | This script returns the application instance. The instance is given to
  39. | the calling script so we can separate the building of the instances
  40. | from the actual running of the application and sending responses.
  41. |
  42. */
  43. return $app;