<?php

/**
 * Root front controller for shared-hosting (subfolder) deployment.
 * Lets the app run at https://itartificer.com/sms-erp without "/public"
 * in the URL. Identical to public/index.php but with paths relative to the
 * project root, so SCRIPT_NAME = /sms-erp/index.php and routing resolves to
 * the /sms-erp base correctly.
 *
 * For local development keep using `php artisan serve` (it serves /public);
 * this file is only used by Apache on the server.
 */

use Illuminate\Foundation\Application;
use Illuminate\Http\Request;

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

if (file_exists($maintenance = __DIR__.'/storage/framework/maintenance.php')) {
    require $maintenance;
}

require __DIR__.'/vendor/autoload.php';

/** @var Application $app */
$app = require_once __DIR__.'/bootstrap/app.php';

$app->handleRequest(Request::capture());
