shez1983's avatar

refactoring view structure - userType based or entity Based?

so right now i am doing something like userType/entity/index.blade.php but i think it makes my structure look more complex. so i want to refactor to just

entity/index...

This causes some problem as for some usertypes i will then have to do entity/UserTypeIndex.blade.. (not that bad as only some views are different)

the other problem is some entity (like holidays for eg) only belong to one user type so having a main folder holiday might be confusing?

0 likes
2 replies
bobbybouwmann's avatar

There is really no wrong answer here. It's up to you to use something that works for you. I normally have a structure like this

- holidays // for example all holidays
-- index.blade.php
-- show.blade.php
- users
-- index.blade.php
-- show.blade.php
-- holidays // for example a holiday template for a specific user
--- index.blade.php

It just depends on your needs and what works for you ;)

1 like
shez1983's avatar

i have been thinking to just have a flat directory structure and not have nested folders - after all its the controllers/policies/routes etc which define who can/cant see a page..

Please or to participate in this conversation.