index.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. header('Access-Control-Allow-Origin: *');
  3. header('Access-Control-Allow-Methods: *');
  4. header('Access-Control-Allow-Headers: Origin, X-Requested-With,Authorization, Content-Type, Accept');
  5. use Illuminate\Contracts\Http\Kernel;
  6. use Illuminate\Http\Request;
  7. define('LARAVEL_START', microtime(true));
  8. /*
  9. |--------------------------------------------------------------------------
  10. | Check If The Application Is Under Maintenance
  11. |--------------------------------------------------------------------------
  12. |
  13. | If the application is in maintenance / demo mode via the "down" command
  14. | we will load this file so that any pre-rendered content can be shown
  15. | instead of starting the framework, which could cause an exception.
  16. |
  17. */
  18. if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {
  19. require $maintenance;
  20. }
  21. /*
  22. |--------------------------------------------------------------------------
  23. | Register The Auto Loader
  24. |--------------------------------------------------------------------------
  25. |
  26. | Composer provides a convenient, automatically generated class loader for
  27. | this application. We just need to utilize it! We'll simply require it
  28. | into the script here so we don't need to manually load our classes.
  29. |
  30. */
  31. require __DIR__.'/../vendor/autoload.php';
  32. /*
  33. |--------------------------------------------------------------------------
  34. | Run The Application
  35. |--------------------------------------------------------------------------
  36. |
  37. | Once we have the application, we can handle the incoming request using
  38. | the application's HTTP kernel. Then, we will send the response back
  39. | to this client's browser, allowing them to enjoy our application.
  40. |
  41. */
  42. $app = require_once __DIR__.'/../bootstrap/app.php';
  43. $kernel = $app->make(Kernel::class);
  44. $response = $kernel->handle(
  45. $request = Request::capture()
  46. )->send();
  47. $kernel->terminate($request, $response);