What convention is used to organize Views of Laravel?

Asked

Viewed 254 times

2

I would like to know how to organize the views in Laravel, in which directory it is best to leave the includes, templates and main views.

Also what is better to put in includes (navbar? layouts? sidebar?) what can I put as template? I am learning Laravel and so far only used templates to make the default structure of HTML, nothing more than that.

1 answer

0

When installing Laravel, it already comes with the pre-configured folders. In this case, the layouts, views..

Overall, in layouts it is customary to leave everything you have of default on the pages, for example the navbar.

In the view organization, follow the MVC standard, in case you have a user CRUD, you at least have three views, list, create and Edit. Then for each controller a folder is created with the screens used by the controller.

Directory map:

-views
   -usuarios
      -list.blade.php
      -edit.blade.php
   -categorias
      -list.blade.php
      -edit.blade.php
      -create.blade.php

Browser other questions tagged

You are not signed in. Login or sign up in order to post.