|
| 1 | +<?php |
| 2 | + |
| 3 | +require_once __DIR__.'/../vendor/autoload.php'; |
| 4 | + |
| 5 | +// Dotenv::load(__DIR__.'/../'); |
| 6 | + |
| 7 | +/* |
| 8 | +|-------------------------------------------------------------------------- |
| 9 | +| Create The Application |
| 10 | +|-------------------------------------------------------------------------- |
| 11 | +| |
| 12 | +| Here we will load the environment and create the application instance |
| 13 | +| that servers as the central piece of the framework. We'll use this |
| 14 | +| application as an "IoC" container and router for this framework. |
| 15 | +| |
| 16 | +*/ |
| 17 | + |
| 18 | +$app = new Laravel\Lumen\Application; |
| 19 | + |
| 20 | +// $app->withFacades(); |
| 21 | + |
| 22 | +// $app->withEloquent(); |
| 23 | + |
| 24 | +/* |
| 25 | +|-------------------------------------------------------------------------- |
| 26 | +| Register Container Bindings |
| 27 | +|-------------------------------------------------------------------------- |
| 28 | +| |
| 29 | +| Now we will register a few bindings in the service container. We will |
| 30 | +| register the exception handler and the console kernel. You may add |
| 31 | +| your own bindings here if you like or you can make another file. |
| 32 | +| |
| 33 | +*/ |
| 34 | + |
| 35 | +$app->singleton( |
| 36 | + 'Illuminate\Contracts\Debug\ExceptionHandler', |
| 37 | + 'App\Exceptions\Handler' |
| 38 | +); |
| 39 | + |
| 40 | +$app->singleton( |
| 41 | + 'Illuminate\Contracts\Console\Kernel', |
| 42 | + 'App\Console\Kernel' |
| 43 | +); |
| 44 | + |
| 45 | +/* |
| 46 | +|-------------------------------------------------------------------------- |
| 47 | +| Register Middleware |
| 48 | +|-------------------------------------------------------------------------- |
| 49 | +| |
| 50 | +| Next, we will register the middleware with the application. These can |
| 51 | +| be global middleware that run before and after each request into a |
| 52 | +| route or middleware that'll be assigned to some specific routes. |
| 53 | +| |
| 54 | +*/ |
| 55 | + |
| 56 | +// $app->middleware([ |
| 57 | +// // 'Illuminate\Cookie\Middleware\EncryptCookies', |
| 58 | +// // 'Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse', |
| 59 | +// // 'Illuminate\Session\Middleware\StartSession', |
| 60 | +// // 'Illuminate\View\Middleware\ShareErrorsFromSession', |
| 61 | +// // 'Laravel\Lumen\Http\Middleware\VerifyCsrfToken', |
| 62 | +// ]); |
| 63 | + |
| 64 | +// $app->routeMiddleware([ |
| 65 | + |
| 66 | +// ]); |
| 67 | + |
| 68 | +/* |
| 69 | +|-------------------------------------------------------------------------- |
| 70 | +| Register Service Providers |
| 71 | +|-------------------------------------------------------------------------- |
| 72 | +| |
| 73 | +| Here we will register all of the application's service providers which |
| 74 | +| are used to bind services into the container. Service providers are |
| 75 | +| totally optional, so you are not required to uncomment this line. |
| 76 | +| |
| 77 | +*/ |
| 78 | + |
| 79 | +// $app->register('App\Providers\AppServiceProvider'); |
| 80 | + |
| 81 | +/* |
| 82 | +|-------------------------------------------------------------------------- |
| 83 | +| Load The Application Routes |
| 84 | +|-------------------------------------------------------------------------- |
| 85 | +| |
| 86 | +| Next we will include the routes file so that they can all be added to |
| 87 | +| the application. This will provide all of the URLs the application |
| 88 | +| can respond to, as well as the controllers that may handle them. |
| 89 | +| |
| 90 | +*/ |
| 91 | + |
| 92 | +require __DIR__.'/../app/Http/routes.php'; |
| 93 | + |
| 94 | +return $app; |
0 commit comments