You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/docs/3.framework-guides/1.laravel/1.automations.md
+14-12Lines changed: 14 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,16 +65,18 @@ Once the database connection is confirmed, the script executes the appropriate m
65
65
Set `AUTORUN_DEBUG=true` to see detailed connection attempt logs, which is helpful for troubleshooting connection issues.
66
66
::
67
67
68
+
## Laravel Artisan commands
69
+
Below is an overview of what Laravel Artisan commands do and how they can be configured.
68
70
69
-
## php artisan storage:link
71
+
###php artisan storage:link
70
72
Creates a symbolic link from `public/storage` to `storage/app/public`.
71
73
72
74
: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"}
73
75
74
-
## php artisan migrate
76
+
###php artisan migrate
75
77
Before running migrations, we ensure the database is online and ready to accept connections. By default, we will wait 30 seconds before timing out.
76
78
77
-
### Migration Modes
79
+
####Migration Modes
78
80
You can control how migrations run using `AUTORUN_LARAVEL_MIGRATION_MODE`:
79
81
80
82
| Mode | Description |
@@ -87,21 +89,21 @@ You can control how migrations run using `AUTORUN_LARAVEL_MIGRATION_MODE`:
87
89
Using `fresh` or `refresh` modes will **drop all tables** in your database. Only use these in development or testing environments.
88
90
::
89
91
90
-
### Force Flag
92
+
####Force Flag
91
93
By default, migrations run with the `--force` flag to bypass production warnings. You can disable this by setting `AUTORUN_LARAVEL_MIGRATION_FORCE` to `false`.
92
94
93
-
### Seeding
95
+
####Seeding
94
96
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.
95
97
96
-
### Specific Database Migrations
98
+
####Specific Database Migrations
97
99
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.
98
100
99
101
| Use case | Description | Value |
100
102
|----------|-------|-------------|
101
103
| Single database | Run migrations on the `mysql` database connection. |`AUTORUN_LARAVEL_MIGRATION_DATABASE=mysql`|
102
104
| 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`|
103
105
104
-
### Isolated Migrations
106
+
####Isolated Migrations
105
107
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.
106
108
107
109
**Special Notes for Isolated Migrations:**
@@ -111,7 +113,7 @@ You can enable the [`--isolated`](https://laravel.com/docs/12.x/migrations#runni
111
113
112
114
: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"}
113
115
114
-
## php artisan optimize
116
+
###php artisan optimize
115
117
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.
116
118
117
119
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
122
124
123
125
: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"}
124
126
125
-
## php artisan config:cache
127
+
###php artisan config:cache
126
128
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.
127
129
128
130
: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"}
129
131
130
-
## php artisan route:cache
132
+
###php artisan route:cache
131
133
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.
132
134
133
135
: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"}
134
136
135
-
## php artisan view:cache
137
+
###php artisan view:cache
136
138
This command caches all of the views in your application, which can greatly decrease the time it takes to render your views.
137
139
138
140
: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"}
139
141
140
-
## php artisan event:cache
142
+
###php artisan event:cache
141
143
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.
142
144
143
145
: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