How to publish config files in Laravel 11
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.