Skip to main content
WritingVideosSpeakingCodeAbout

Kit docs

Configuration

PHP ^8.513 pages

Docs for v0.2.1, from GitHub.

Pages in these docs

These are the environment variables Kit adds, or gives a meaning of its own. Laravel’s standard ones (DB_*, MAIL_*, CACHE_STORE and the rest) behave as they do in any Laravel application.

“Default” means the value when the variable is not set at all. Where .env.example sets something different for local development, the table says so.

Application

VariableDefaultEffect
APP_URLhttp://localhostMust be https:// in production. Webhook source and origin derive from it
APP_LOCALEenLaravel’s default locale
APP_FALLBACK_LOCALEenUsed for translation keys a locale is missing
APP_SUPPORTED_LOCALESen,esLanguages a client can ask for; the first is used when none match. See Localization
QUEUE_CONNECTIONdatabaseNeeds a worker. Webhook rate limits need a driver that can delay, so not sync
MAIL_MAILERlogVerification and reset emails go to the log until you set a mailer

Tokens

VariableDefaultEffect
SANCTUM_EXPIRATION120Minutes a session token from register or login lasts
API_KEY_DEFAULT_DAYS90Days an API key lasts when it is created without expires_at
API_KEY_MAX_DAYS365The furthest away an API key’s expires_at can be
IDEMPOTENCY_TTL86400Seconds an idempotent response is kept for replay
APP_PREVIOUS_KEYSnoneLaravel’s own. Keep a rotated APP_KEY here for at least IDEMPOTENCY_TTL, or stored idempotent responses cannot be decrypted

Security

VariableDefaultEffect
SECURITY_FORCE_HTTPSfalseRefuse plain HTTP requests with a 400. Must be true in production
SECURITY_HSTS_ENABLEDtrueSend Strict-Transport-Security on HTTPS responses
SECURITY_HSTS_MAX_AGE31536000HSTS max-age, in seconds
SECURITY_HSTS_INCLUDE_SUBDOMAINStrueAdd includeSubDomains
SECURITY_HSTS_PRELOADfalseAdd preload
TRUSTED_PROXIES*Proxies whose X-Forwarded-* headers are believed
TRUSTED_HOSTSempty (.env.example: localhost,127.0.0.1)Host names the API answers to. Required in production
CORS_ALLOWED_ORIGINShttp://localhost:3000Browser origins allowed to call the API. * is refused in production

See Security.

Webhooks

VariableDefaultEffect
WEBHOOKS_SOURCEAPP_URL plus /v1The CloudEvents source of every event
WEBHOOKS_ORIGINAPP_URL’s hostSent as WebHook-Request-Origin
WEBHOOKS_REQUIRE_HTTPStrue (.env.example: false)Refuse subscription URLs that are not https
WEBHOOKS_ALLOW_PRIVATE_NETWORKSfalse (.env.example: true)Allow URLs that resolve to private, loopback or reserved addresses
WEBHOOKS_VALIDATE_ENDPOINTSfalseRequire each endpoint to consent through the CloudEvents handshake
WEBHOOKS_CALLBACK_HOURS72Hours a consent callback link stays valid
WEBHOOKS_REQUEST_RATEnoneDeliveries a minute to ask each endpoint for
WEBHOOKS_TIMEOUT10Seconds to wait for an endpoint to answer
WEBHOOKS_DISABLE_AFTER10Failed deliveries in a row before a subscription is disabled
WEBHOOKS_RETENTION_DAYS30Days events and their deliveries are kept

The retry schedule is backoff in config/webhooks.php, and the event types subscribers can ask for are events in the same file. See Webhooks.

The Docker image

VariableDefaultEffect
PORT8000The port Octane listens on
OCTANE_WORKERSautoPHP workers
OCTANE_MAX_REQUESTS500Requests a worker serves before it is replaced

The image sets APP_ENV=production, APP_DEBUG=false and LOG_CHANNEL=stderr itself. See Deployment.

Configuration files

Some settings deliberately have no variable, because changing them should go through code review:

FileWhat it holds
config/api-toolbox.phpWhich HTTP standards are on, and how each behaves
config/sanctum.phpThe abilities, and which ones session tokens get
config/webhooks.phpEvent types and the retry schedule
config/security.phpTransport settings read from the variables above
config/cors.phpPaths, methods and exposed headers
config/scribe.phpHow the API documentation is generated
app/Providers/AppServiceProvider.phpRate limiters