Laravel setup
Published
Updated
Create a fortrabbit app for Laravel. The Laravel software template sets the root path to public, the ENV vars for app and database, and the build and post deploy commands, so Laravel runs without config changes.
Get ready
- Local development environment up and running.
- Laravel installed locally best with attached Git repo.
- Install the fortrabbit GitHub App for automatic deployments.
Create an app at fortrabbit
Create an app in the dashboard and connect the GitHub repository.
Software template
When Laravel is detected or chosen, the Laravel software template applies:
Laravel 13, 12, 11, 10, 9, 8, 7, 6, 5, 4
| Deployment | Value |
|---|---|
| Root path | public |
| Deploy strategy | replace |
| Excluded paths | /storage/node_modules |
| Build commands | composer install --no-dev --prefer-dist --no-interaction --no-ansi --no-progress |
| Post-deploy commands | mkdir -p storage/framework/{sessions,views,cache}php artisan migrate --force |
| Environment variables | Value |
|---|---|
| APP_DEBUG | false |
| APP_ENV | production |
| APP_KEY | !RANDOM_KEY! |
| APP_URL | https://${FORTRABBIT_MAIN_DOMAIN} |
| LOG_CHANNEL | stack |
| LOG_STACK | stderr |
| Database environment variables | Value |
|---|---|
| DB_CONNECTION | ${FORTRABBIT_DB_TYPE} |
| DB_DATABASE | ${FORTRABBIT_DB_NAME} |
| DB_HOST | ${FORTRABBIT_DB_HOST} |
| DB_PASSWORD | ${FORTRABBIT_DB_PASSWORD} |
| DB_PORT | ${FORTRABBIT_DB_PORT} |
| DB_USERNAME | ${FORTRABBIT_DB_USER} |
MySQL configuration
Keep config/database.php as it is. The template fills DB_HOST, DB_PASSWORD and the other DB_* variables from the MySQL component. Locally, the .env file holds the local credentials, see ENV vars.