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

(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 $path . 'core/includes/settings.php';

// set environment
$app['env'] = config('app.env');

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

(new \Mtcmedia\Mailer\MailerServiceProvider($app))->register();

return $app;

