
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.
Did you like this article? Then, keep learning:
- Manage asynchronous caching in Laravel for better performance
- Clear Laravel's cache effectively, useful when working with config changes
- Learn how to customize middleware in the new minimal Laravel 11 skeleton
- Learn how to publish API and broadcasting routes in Laravel 11
- Upgrade guide to Laravel 10; relevant if upgrading towards Laravel 11
- Step-by-step upgrade guide to Laravel 11; essential after config changes
- Comprehensive review of Laravel 11 new features and big changes
- Master Laravel's query builder where clauses to optimize database queries
- Learn how to secure REST APIs with Laravel Sanctum; complements app config
- Discover how Artisan commands can optimize your Laravel development