composer config
command. You should add this command to your build commands prior to invoking composer install
:
php artisan config:cache
or php artisan optimize
afterwards to ensure the configuration is properly cached:
php artisan optimize
or php artisan config:cache
is only necessary if you’re dynamically adding environment variables during the build process.php artisan optimize
or php artisan config:cache
(for example, after adding dynamic environment variables), you must prefix these commands with LARAVEL_CLOUD=1
to ensure all Laravel Cloud configurations are properly loaded:
LARAVEL_CLOUD=1
environment variable ensures that all Laravel Cloud-specific configurations are in place during the build process.
php artisan queue:restart
- Queue workers are automatically restarted after each deploymentphp artisan horizon:terminate
- Horizon processes are automatically managed during deploymentsphp artisan optimize
- This command has no effect during the deploy phase as optimizations should be done during buildphp artisan optimize:clear
- This clears the cache and can cause unexpected behavior, especially related to the queuephp artisan storage:link
- The symbolic link won’t persist as changes made during deploy commands are not saved. Use Laravel Object Storage for persistent file storage instead..env
variables available to your environment.
php -m
using Laravel Cloud’s “Command” feature in your environment dashboard.
memory_limit
.
You can override the default memory limit by adding configuration directly in your application code. The most common method is to update your public/index.php
and your artisan
file:
laravel.cloud
domain the first time it is deployed successfully. This makes it easy to test and build your application before attaching a custom domain.
Laravel Cloud domains are constructed using a combination of your application and environment name. If either of these names are changed, the Laravel Cloud domain will be updated to reflect the changes. A redeployment is required for this change to take effect.
*.example.com
), you must also add and point the root domain (e.g., example.com
) to Laravel Cloud. Both the wildcard domain and the root domain must be properly configured with the appropriate DNS records pointing to your Laravel Cloud environment.
Finally, if your domain / DNS is managed by Cloudflare, you should disable the Cloudflare proxy (Orange Cloud) to allow the domain to be verified.
_cf-custom-hostname.example.com.example.com
vs. _cf-custom-hostname.example.com
CACHE_PREFIX
environment variable to your applicationphp artisan cache:clear
.
main
), including compute, resources, and environment variables.main
) to use as a base. This environment’s configuration (compute, resources, environment variables, etc.) will be used for each preview environment.main
).php artisan migrate --force
). These commands are useful for setting up preview-specific data or configurations.APP_KEY
from the replicated environment. Avoid connecting preview environments to production databases, caches, or other sensitive resources. We recommend against replicating a production environment for previews. If you share a database cluster or schema across environments, be aware that running migrations or making breaking changes can impact other environments.redis
or database
drivers for a persistent cache and session via a KV Store or database resource. For persistent file storage, use the s3
driver via Laravel Object Storage.
Install Nightwatch package
composer require laravel/nightwatch
on your local machine to update your composer.json
and composer.lock
files before deploying.Connect Nightwatch
Enable monitoring
Enter your Nightwatch token