Skip to content

Commit f71f417

Browse files
committed
Improved structure of automation docs
1 parent c99062f commit f71f417

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

docs/content/docs/3.framework-guides/1.laravel/1.automations.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,18 @@ Once the database connection is confirmed, the script executes the appropriate m
6565
Set `AUTORUN_DEBUG=true` to see detailed connection attempt logs, which is helpful for troubleshooting connection issues.
6666
::
6767

68+
## Laravel Artisan commands
69+
Below is an overview of what Laravel Artisan commands do and how they can be configured.
6870

69-
## php artisan storage:link
71+
### php artisan storage:link
7072
Creates a symbolic link from `public/storage` to `storage/app/public`.
7173

7274
:u-button{to="https://laravel.com/docs/12.x/filesystem#the-public-disk" target="_blank" label="Read more about storage links" aria-label="Read more about storage links" size="md" color="primary" variant="outline" trailing-icon="i-lucide-arrow-right" class="font-bold"}
7375

74-
## php artisan migrate
76+
### php artisan migrate
7577
Before running migrations, we ensure the database is online and ready to accept connections. By default, we will wait 30 seconds before timing out.
7678

77-
### Migration Modes
79+
#### Migration Modes
7880
You can control how migrations run using `AUTORUN_LARAVEL_MIGRATION_MODE`:
7981

8082
| Mode | Description |
@@ -87,21 +89,21 @@ You can control how migrations run using `AUTORUN_LARAVEL_MIGRATION_MODE`:
8789
Using `fresh` or `refresh` modes will **drop all tables** in your database. Only use these in development or testing environments.
8890
::
8991

90-
### Force Flag
92+
#### Force Flag
9193
By default, migrations run with the `--force` flag to bypass production warnings. You can disable this by setting `AUTORUN_LARAVEL_MIGRATION_FORCE` to `false`.
9294

93-
### Seeding
95+
#### Seeding
9496
You can automatically seed your database after migrations by setting `AUTORUN_LARAVEL_MIGRATION_SEED` to `true`. This adds the `--seed` flag to your migration command.
9597

96-
### Specific Database Migrations
98+
#### Specific Database Migrations
9799
If you need to specify the exact database connection to use for migrations, you can set `AUTORUN_LARAVEL_MIGRATION_DATABASE` to the name of the database connection you want to use.
98100

99101
| Use case | Description | Value |
100102
|----------|-------|-------------|
101103
| Single database | Run migrations on the `mysql` database connection. | `AUTORUN_LARAVEL_MIGRATION_DATABASE=mysql` |
102104
| Multiple databases | In the rare case you need to use multiple databases, you can provide a comma-delimited list of connection names (e.g., "mysql,pgsql"). | `AUTORUN_LARAVEL_MIGRATION_DATABASE=mysql,pgsql` |
103105

104-
### Isolated Migrations
106+
#### Isolated Migrations
105107
You can enable the [`--isolated`](https://laravel.com/docs/12.x/migrations#running-migrations) flag by setting `AUTORUN_LARAVEL_MIGRATION_ISOLATION` to `true`, which will ensure no other containers are running a migration.
106108

107109
**Special Notes for Isolated Migrations:**
@@ -111,7 +113,7 @@ You can enable the [`--isolated`](https://laravel.com/docs/12.x/migrations#runni
111113

112114
:u-button{to="https://laravel.com/docs/12.x/migrations#running-migrations" target="_blank" label="Read more about migrations" aria-label="Read more about migrations" size="md" color="primary" variant="outline" trailing-icon="i-lucide-arrow-right" class="font-bold"}
113115

114-
## php artisan optimize
116+
### php artisan optimize
115117
Laravel comes with an artisan command called `optimize`, which will optimize the application by caching the configuration, routes, views, and events all in one command.
116118

117119
You can disable any cache features by setting the corresponding environment variable to `false` (for example, `AUTORUN_LARAVEL_CONFIG_CACHE` would disable configuration caching).
@@ -122,22 +124,22 @@ It's possible to disable the `optimize` command by setting `AUTORUN_LARAVEL_OPTI
122124

123125
:u-button{to="https://laravel.com/docs/12.x/deployment#optimization" target="_blank" label="Read more about optimizing Laravel" aria-label="Read more about optimizing Laravel" size="md" color="primary" variant="outline" trailing-icon="i-lucide-arrow-right" class="font-bold"}
124126

125-
## php artisan config:cache
127+
### php artisan config:cache
126128
This command caches all configuration files into a single file, which can then be quickly loaded by Laravel. Once the configuration is cache, the `.env` file will no longer be loaded.
127129

128130
:u-button{to="https://laravel.com/docs/12.x/configuration#configuration-caching" target="_blank" label="Read more about configuration caching" aria-label="Read more about configuration caching" size="md" color="primary" variant="outline" trailing-icon="i-lucide-arrow-right" class="font-bold"}
129131

130-
## php artisan route:cache
132+
### php artisan route:cache
131133
This command caches the routes, dramatically decrease the time it takes to register all of your application's routes. After running this command, your cached routes file will be loaded on every request.
132134

133135
:u-button{to="https://laravel.com/docs/12.x/routing#route-caching" target="_blank" label="Read more about route caching" aria-label="Read more about route caching" size="md" color="primary" variant="outline" trailing-icon="i-lucide-arrow-right" class="font-bold"}
134136

135-
## php artisan view:cache
137+
### php artisan view:cache
136138
This command caches all of the views in your application, which can greatly decrease the time it takes to render your views.
137139

138140
:u-button{to="https://laravel.com/docs/12.x/views#optimizing-views" target="_blank" label="Read more about view caching" aria-label="Read more about view caching" size="md" color="primary" variant="outline" trailing-icon="i-lucide-arrow-right" class="font-bold"}
139141

140-
## php artisan event:cache
142+
### php artisan event:cache
141143
This command creates a manifest of all your application's events and listeners, which can greatly speed up the process of registering them with Laravel.
142144

143145
:u-button{to="https://laravel.com/docs/12.x/events#event-discovery-in-production" target="_blank" label="Read more about event caching" aria-label="Read more about event caching" size="md" color="primary" variant="outline" trailing-icon="i-lucide-arrow-right" class="font-bold"}

0 commit comments

Comments
 (0)