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

SupaMonkey's avatar

UX for Model with Children in Admin Panel in Laravel

Would like everyones input on how to layout a CRUD for an admin panel. First, the 'basic' data layout:

- tblSchool (parent)
- tblCars
- tblContacts (eg: John/Mary/Joe)
- tblContactType (eg: Admin/Manager/Accounts)
- tblContactDetails (eg: 012-345-6789/[email protected])
- tblContactDetailTypes (eg: Telephone/Facsimilie/Mobile/Email)

- pivotTblCars (connect tblSchool with tblCars)
- pivotTblContacts (connect tblSchool with tblContacts)

Firstly, pivot tables are there for referential integrity and there are other (parents) which share the same details and hence the need for the pivot tables.

So standard CRUD would just be a separate page for each element type, each having its own index, create, edit and possibly show page.

1) So one approach for example could be: 'School' index would have a grid of all the schools - then you would select a school and click a 'manage contacts' button to get taken to the 'Contacts' index page where you would manage all the contacts of the selected School. Then you would have to go 'back' to then either manage another schools contacts and/or its 'Cars'.

2) Another approach could be that when a School is selected, sub grids below the school grid could load the children (car/contacts) data. This seems disconnected and unintuitive though.

3) Another approach could be that you would 'view' a school to see its data and at the same time it would be the index/grids for the 'Cars' and 'Contacts' below its data (eg: 50% page width grid for each of these children?

I'm just spit balling above; please feel free to enlighten me with other approaches. Right now, leaning towards option 3 but also unsure how I would carry across the parent_id without it getting complicated by editing/customising a large set of routes, etc etc.

How would you handle a more inclusive approach with less steps/better flow?

0 likes
1 reply

Please or to participate in this conversation.