Skip to content

Commit 44d5e8e

Browse files
committed
Update Laravel Automations documentation with detailed environment variables and database connection checks
1 parent c73193f commit 44d5e8e

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

docs/content/docs/4.laravel/1.laravel-automations.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,26 @@ layout: docs
1313
In order for this script to run,`AUTORUN_ENABLED` must be set to `true`. Once the main part of the script is enabled, you can control the individual tasks by setting the corresponding environment variables to `true` or `false`. See our [variable reference document](/docs/reference/environment-variable-specification) for more details.
1414
::
1515

16-
| Environment Variable | Laravel Command | Description |
16+
| Environment Variable | Default | Description |
1717
| -------------------- | -------------- | ----------- |
18-
| `AUTORUN_LARAVEL_STORAGE_LINK` | `php artisan storage:link` | Creates a symbolic link from `public/storage` to `storage/app/public`. |
19-
| `AUTORUN_LARAVEL_MIGRATION` | `php artisan migrate` | Runs migrations. |
20-
| `AUTORUN_LARAVEL_OPTIMIZE` | `php artisan optimize` | Optimizes the application. |
21-
| `AUTORUN_LARAVEL_CONFIG_CACHE` | `php artisan config:cache` | Caches the configuration files into a single file. |
22-
| `AUTORUN_LARAVEL_ROUTE_CACHE` | `php artisan route:cache` | Caches the routes. |
23-
| `AUTORUN_LARAVEL_VIEW_CACHE` | `php artisan view:cache` | Caches the views. |
24-
| `AUTORUN_LARAVEL_EVENT_CACHE` | `php artisan event:cache` | Creates a manifest of all your application's events and listeners. |
18+
| `AUTORUN_ENABLED` | `false` | Enables the Laravel Automations script. <br> **ℹ️ Note:** This must be set to `true` for the script to run. |
19+
| `AUTORUN_DEBUG` | `false` | Enables a special debug mode, specifically for the Laravel Automations script. |
20+
| `AUTORUN_LARAVEL_CONFIG_CACHE` | `true` | `php artisan config:cache`: Caches the configuration files into a single file. |
21+
| `AUTORUN_LARAVEL_EVENT_CACHE` | `true` | `php artisan event:cache`: Creates a manifest of all your application's events and listeners. |
22+
| `AUTORUN_LARAVEL_MIGRATION` | `true` | `php artisan migrate`: Runs migrations. |
23+
| `AUTORUN_LARAVEL_MIGRATION_ISOLATION` | `false` | Run your migrations with the [`--isolated`](https://laravel.com/docs/12.x/migrations#running-migrations) flag. <br> **ℹ️ Note:** Requires Laravel v9.38.0+ |
24+
| `AUTORUN_LARAVEL_MIGRATION_TIMEOUT` | `30` | Number of seconds to wait for database connection before timing out during migrations. |
25+
| `AUTORUN_LARAVEL_OPTIMIZE` | `true` | `php artisan optimize`: Optimizes the application. |
26+
| `AUTORUN_LARAVEL_ROUTE_CACHE` | `true` | `php artisan route:cache`: Caches the routes. |
27+
| `AUTORUN_LARAVEL_STORAGE_LINK` | `true` | `php artisan storage:link`: Creates a symbolic link from `public/storage` to `storage/app/public`. |
28+
| `AUTORUN_LARAVEL_VIEW_CACHE` | `true` | `php artisan view:cache`: Caches the views. |
29+
30+
## Database Connection Checks
31+
Before running migrations, the script performs database connection checks to ensure the database is ready. It will:
32+
- Clear the Laravel configuration cache before attempting migrations
33+
- Try to connect to the database for up to `AUTORUN_LARAVEL_MIGRATION_TIMEOUT` seconds (default: 30)
34+
- Automatically detect and handle SQLite databases differently
35+
- Show detailed connection attempts when `AUTORUN_DEBUG` is enabled
2536

2637
## php artisan storage:link
2738
Creates a symbolic link from `public/storage` to `storage/app/public`.

0 commit comments

Comments
 (0)