Zum Inhalt springen
GigadriveDocs

Laravel

What Gigadrive Network detects for a Laravel project, which PHP runtime it uses, and the one variable you have to set yourself.

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 and SESSION_DRIVER=cookie into the configuration it generates, and none of them reach your Function: config-file environment variables are accepted and not applied. Set the ones your application needs under Environment variables, the same way you set APP_KEY. Keep both log channels on stderr there, because storage/ is excluded from the deployed package and a file log would have nowhere to go.

Runtimes and how requests are served

The available PHP runtime identifiers are php-84, php-83 and php-81. 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.