Anybuild documentation
Laravel
Build Laravel applications with Composer and Node.js asset steps.
Detection
Laravel is selected when a project contains both artisan and composer.json. Composer is enabled automatically.
PHP and frontend assets
The Laravel provider combines the PHP builder with Node.js asset steps. It preserves the detected package manager, Node.js version, and frontend build command, then serves the application from public by default.
Configuration
Laravel inherits all configuration from the PHP provider configuration, plus the package manager, framework, server, dependency, asset-build, and Node.js version options from the Node.js provider configuration. The provider-prefixed fields coexist, so php_framework and node_framework can be configured independently. Composer is always enabled.
Generated definition
Anybuild
load("//anybuild/tools:laravel.bzl", "laravel_build", "laravel_config", "laravel_serve")
config = laravel_config( schema = 1, node_package_manager = "npm", node_build_command = "npm run build", node_version = "24", php_framework = "laravel", composer_enable = True, composer_build_script = "post-update-cmd", php_version = "8.3.29", php_public_dir = "public",)
build = laravel_build(config)laravel_serve(config, build, name = "php-laravel-react")