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

aurelianspodarec's avatar

How do you structure Laravel Views?

Hi there!

How do you structure Laravel views?

I tried searching for different ways and only found this https://darkghosthunter.medium.com/laravel-organizing-your-sea-of-views-d9ff85f2f3cf which I'm actually doing it like that.

Though its quite simplistic.

I wonder how do you guys go about structuring your Laravle views folders.

I like the idea of putting things in the 'web' folder. In React, you would do similar thing.

I really hate how laravel did that part, just feels off. Views mixed with components basically what the guy said in the article.

0 likes
7 replies
vincent15000's avatar

I think you have a great freedom to organize your views according to your needs.

I tried several ways like for example : all admin views in an admin folder, all member views in a member folder, ... this is quite good if the admin never needs to access the member folder ... but its not a good way.

The better way I have found is to organize my views by model.

1 like
aurelianspodarec's avatar

@vincent15000 Right, what about components, views that share one layout, do you then put that in components or?

This kinda feels messy compared to how you can do it in React. Maybe we can do it its just done bit differently.

I just remembered that we can use @include @extend @sectoin etc... maybe that could be of use to include some views inside views or do some neat magic.

Will give it a try again tomorrow morning ^^ Really need to figure this out now as the project was getting way to messy.

martinbean's avatar

@aurelianspodarec I tend to follow a very “resource” heavy approach to routing, controllers, views, etc.

So for say, a Post model, I’ll have a PostController with the standard resource actions (index, create, store, etc). I’ll then have corresponding views for the actions that need them:

  • resources/views/posts/index.blade.php
  • resources/views/posts/create.blade.php
  • resources/views/posts/show.blade.php
  • resources/views/posts/edit.blade.php
1 like

Please or to participate in this conversation.