Skip to content
GigadriveDocs

Laravel

What Gigadrive Network detects for a Laravel project, which PHP runtime it uses, and the defaults that let it run without any configuration.

Gigadrive Network detects Laravel when your composer.json requires laravel/framework and an artisan file sits at the project root. Both have to match. public/index.php becomes the Function that answers every path.

Defaults

SettingValue
Runtimephp-84
Memory256 MB
Max duration30 seconds
Entrypointpublic/index.php
Route/* to the entrypoint
Assetspublic
Excludedtests/, storage/, .ddev, node_modules/

The preset also writes APP_NAME=Laravel, APP_ENV=production, APP_DEBUG=false, LOG_CHANNEL=stderr, LOG_DEPRECATIONS_CHANNEL=stderr, LOG_LEVEL=debug, BROADCAST_DRIVER=log, SESSION_DRIVER=cookie, CACHE_STORE=file and QUEUE_CONNECTION=sync. They reach your Function as defaults, and a variable you store under Environment variables with the same name replaces one. The cookie session driver and the file cache avoid the database the Laravel skeleton defaults to; switch them to database or redis once your application has one.

storage/ is left out of the deployed package, and the directories Laravel writes to at runtime are created empty and writable: storage/framework/views, storage/framework/cache/data, storage/framework/sessions, storage/logs, storage/app/public and bootstrap/cache. Compiled views and the file cache work without any setting. What a Function writes there stays with that copy of the Function and is gone when it stops, so keep logs on stderr and anything that must last in a database, a cache server or File Storage.

Runtimes and how requests are served

The available PHP runtime identifiers are php-84 and php-83. Laravel defaults to php-84.

Every request runs public/index.php as a front controller, so $_SERVER['SCRIPT_NAME'] is /index.php and the request path arrives in PATH_INFO the way PHP-FPM presents it. Laravel's router takes it from there.

That front controller is the only route the preset creates, so a request for public/css/app.css reaches PHP too. The preset also walks public after the build and publishes everything else inside it, so compiled assets, images and fonts reach the edge with no configuration of your own.

public/index.php is dropped from the published set because it is also the Function entrypoint, and every other .php, .phtml or .phar file under public is skipped as well: an exact-path asset route would otherwise outrank the front controller's wildcard route and serve that file's source instead of running it.

PHP responses are not streamed, so the whole response is buffered before it is sent. A fatal that produces no response at all is returned as 502 with the PHP error written to the logs rather than as an empty 200.

The build

The build runs composer install --no-interaction from the repository root whenever a composer.lock is there. JavaScript dependencies are installed separately, from whichever lockfile the repository carries, and a build script in package.json runs after them. That is how a Vite front end is compiled into public/build.

Changing the defaults

version: 4
functions:
  public/index.php:
    runtime: php-83
    memory: 512
    max_duration: 60

Declaring the Function replaces the preset's entrypoint, and any setting you omit falls back to the config file's own defaults of memory: 128 and max_duration: 30 instead of the preset's 256 MB. Set both explicitly.

Laravel's own documentation lives at laravel.com/docs.