logo
podcast Podcast
get help Get Unstuck

What config files should you keep in Laravel 11?

As usual, I like the defaults

Joel Clermont
Joel Clermont
2025-03-05

In the move from Laravel 10 to 11, there were some changes to the way a default app is structured.

One of those changes is the number of files in the config directory. With the introduction of Laravel 11, some of those files "disappeared", like config/cors.php or config/hashing.php.

They didn't actually get removed from the framework. They just aren't published into your application, because it's pretty rare for the typical app to customize them.

Instead, Laravel merges your published configuration files with the framework defaults.

This allows you to not only "slim down" files you don't customize at all, but the merging is also done recursively, so you can even eliminate portions of your published config files that you don't customize.

The question is: How far should you go with this?

My preference is to keep the files that would have been published if I ran laravel new. I want my app to look like a default app.

And even though I could slim those published files down further, I don't like doing this. I want the file there and visible, just like they would be in a freshly installed app.

And if defaults change over time, I want to then merge those in explicitly, and not just be surprised that something changed in the framework.

Here to help,

Joel

P.S. Has your app slowly become more complicated over time? We can help you simplify it and easier to maintain

Toss a coin in the jar if you found this helpful.
Want a tip like this in your inbox every weekday? Sign up below 👇🏼
email
No spam. Only real-world advice you can use.