<?php

// Load the bootstrap file that defines base classes like kernels and error handler
$app = require_once dirname(__DIR__, 2) . '/bootstrap/app.php';

$app->singleton('request', function () {
    return \Illuminate\Http\Request::capture();
});

(new \Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables())->bootstrap($app);
(new \Illuminate\Foundation\Bootstrap\LoadConfiguration())->bootstrap($app);
(new \Illuminate\Foundation\Bootstrap\RegisterFacades())->bootstrap($app);
(new \Illuminate\Foundation\Bootstrap\RegisterProviders())->bootstrap($app);
(new \Illuminate\Foundation\Bootstrap\BootProviders())->bootstrap($app);

require_once SITE_PATH . '/core/includes/settings.php';

// set environment
$app['env'] = ENVIRONMENT;

return $app;
