<?php

use Illuminate\Http\Request;

define('LARAVEL_START', microtime(true));

// 1. Check for Maintenance Mode
if (file_exists($maintenance = __DIR__ . '/../../casheco_core/storage/framework/maintenance.php')) {
    require $maintenance;
}

// 2. Register the Composer Autoloader
require __DIR__ . '/../../casheco_core/vendor/autoload.php';

// 3. Bootstrap Laravel
$app = require_once __DIR__ . '/../../casheco_core/bootstrap/app.php';

// 4. Handle the Request
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);

$response = $kernel->handle(
    $request = Request::capture()
);

$response->send();

$kernel->terminate($request, $response);
