Example #1
0
 /**
  * Creates the application.
  *
  * @return \Laravel\Lumen\Application
  */
 public function createApplication()
 {
     if (!class_exists('Laravel\\Lumen\\Application')) {
         require_once __DIR__ . '/../vendor/autoload.php';
     }
     $app = new \Laravel\Lumen\Application(realpath(__DIR__));
     $app->withFacades();
     $app->withEloquent();
     return $app;
 }
Example #2
0
require_once __DIR__ . '/../vendor/autoload.php';
Dotenv::load(__DIR__ . '/../');
/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| Here we will load the environment and create the application instance
| that serves as the central piece of this framework. We'll use this
| application as an "IoC" container and router for this framework.
|
*/
$app = new Laravel\Lumen\Application(realpath(__DIR__ . '/../'));
$app->withFacades();
$app->withEloquent();
/*
|--------------------------------------------------------------------------
| Register Container Bindings
|--------------------------------------------------------------------------
|
| Now we will register a few bindings in the service container. We will
| register the exception handler and the console kernel. You may add
| your own bindings here if you like or you can make another file.
|
*/
$app->singleton(Illuminate\Contracts\Debug\ExceptionHandler::class, App\Exceptions\Handler::class);
$app->singleton(Illuminate\Contracts\Console\Kernel::class, App\Console\Kernel::class);
/*
|--------------------------------------------------------------------------
| Register Middleware