custom fields user table
hi, what you guys recommend me for this?
i have a php system without any framework
i want to migrate to filament
currently it have two tables one for admin login, one for client login
should i have the same in filament? i mean two diff table for login? the difference is the client table have many custom fields like address, identification, passport, phone, mail, services, mobile and so on that admin table doesn't have. or should i use one table only of users and have a client_detail table for example with a foreign key that links to the user table?
thank you
Solution:Jump to solution
both approaches are possible. However, I would keep a single table and using a HasOne relationship to store the client-specific fields.
Laravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
9 Replies
Solution
both approaches are possible. However, I would keep a single table and using a HasOne relationship to store the client-specific fields.
Laravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
so in my users table i need to create the 20 custom fields?
what about the page to create users, should i have two? one to create regular admin users and other for clients? as i dont want to see too many fields when creating admin for example
sorry to ask too many questions, im trying to replicate my current php app (i dont have source code) so we are wanting to move slowly to filament from a pure php app that is like 15 years old
Check the laravel relationships
ok
not sure if i understand, but in that case it shows user model and phone model so two db tables right? or im missunderstanding the concept.
yes, two models, two tables
oh got it so a regular user and maybe a client_details table with the relationship and primary key
to get all details
and regards the page to create edit? should i have one for admin and one for regular clients so i can show the fields according
i was confused and you said keep a single table
but now im clear i keep one table for users in general and another for client details
I mean single user table
got it, thanks a lot