DEV Community

Techsolutionstuff
Techsolutionstuff

Posted on • Originally published at techsolutionstuff.com

How to Publish Config Files in Laravel 11

Hey there! If you're diving into Laravel 11 and need to customize your configuration settings, you're in the right place.

In this guide, I'll walk you through the straightforward process of publishing config files.

In this, we'll see how to publish a config file in laravel 11.

In Laravel 11, the default setup includes empty config folders.

While you can adjust configurations using the .env file, modifying config files requires a different approach.

To make changes, you'll need to publish these files using an artisan command.

So, let's see laravel 11 publish an app config file, laravel 11 publish a database config file, and laravel 11 publish a config file command.

Run the following command to publish the config file in laravel 11.

php artisan config:publish
Enter fullscreen mode Exit fullscreen mode

After running this command you will get a list of config files:

publish-config-file-in-laravel-11

publish-cors-config-file-in-laravel-11

Laravel 11 Publish All Config Files

If you want to publish all configuration files in Laravel 11, Laravel provides a command specifically for this purpose.

Run the following command to publish all configuration files in laravel 11.

php artisan config:publish --all
Enter fullscreen mode Exit fullscreen mode

You might also like:

Read Also: How to Publish API Route File in Laravel 11

Top comments (0)