Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Ligonsker's avatar

Is there a mistake in the docs in the directory structure page?

I created a clean Laravel 9 project

In the docs, in the directory structure page, it shows lang is in the root: https://laravel.com/docs/9.x/structure

But I just tested localization and by default (at least on Laravel 9), it worked only when I put the lang directory inside resources. It didn't work when I put it in the root of the project

0 likes
5 replies
Sinnbeck's avatar

If you check this, you can see it's correct https://github.com/laravel/laravel

But it works in both places. It was moved recently so there is still support for the old location. The problem might have been that you had an empty lang folder in resources

1 like
Ligonsker's avatar

@Sinnbeck I just re-checked, I had no empty lang in resources - I added it (after the default location in the root didn't work). Now I deleted the one in resources, added it back to the root. cleared all caches (optimize:clear), and it stopped working.

I then moved the folder back to resources and it worked again

Please or to participate in this conversation.