Boot Sequence
When Application::run() or Application::boot() is called, the following steps execute in order:
-
Load
.env—vlucas/phpdotenvloads environment variables from your project root. Missing variables do not throw; they simply remain unset. -
Create Container — A fresh
Containerinstance is created.RouterandGenerator(OpenAPI) are registered as singletons immediately. -
Auto-discover bridge providers — Antares reads
vendor/composer/installed.jsonand collects anyextra.antares.providersentries from installed packages. Bridge providers (Monolog, Eloquent) are registered this way — no manual registration required. -
Register service providers — Each class passed to
->providers([...])is instantiated and itsregister()method is called with the container. -
Register route providers (or load cache) — In production (
APP_ENV=production) with a valid cache fingerprint, the compiled route cache is loaded directly. Otherwise, each route provider’sregister()is called and the OpenAPI controller is added automatically. -
Wire Dispatcher, ErrorHandler, Pipeline — The Dispatcher, ErrorHandler, and Pipeline are created and stored on the application instance, ready to handle requests.
Cache Fingerprint
Section titled “Cache Fingerprint”The route cache fingerprint is computed from:
composer.lock.env- All files under
app/
If any of these change, the fingerprint changes and the cache is invalidated automatically on the next request.