How to publish config files in Laravel 11

How to publish config files in Laravel 11

Modified
Mar 21, 2024
Written by
Benjamin Crozat
0
comments
1 minutes
read

To publish additional configuration files in Laravel 11, use:

php artisan config:publish

Laravel will then ask you to choose which configuration file you want to publish.

And by the way, you can also publish them all at once using:

php artisan config:publish --all

Why is this necessary now? Because starting from Laravel 11, new projects get to experience a slimmer skeleton. Part of the efforts to make it happen was:

  • Cleaning up the configuration files (some values were actually removed).
  • Updating the .env.example file with more environment variables to make the framework more configurable in one place.
  • Reducing the amount of published files, which can be overwhelming for new developers. For instance, the cors.php, hashing.php, and view.php files are missing.

Did you like this article? Then, keep learning: