How to show same table data in different pages?

I have a user table and there have a column role where have different roles like 'admin', 'agent', and 'customer'. Now I want to show users in different pages role based, how to do that? Also, when I want to create user, I want to add some extra data on other table if user type is agent or customer.
6 Replies
Muhaimin Shihab
Muhaimin ShihabOP15mo ago
can you please give me a real example of that how i can do that?
Vp
Vp15mo ago
what kind of real example rather than those links? maybe I am not clear about the exact requirement you had. if you can post how you tried then it will be easy to help
Muhaimin Shihab
Muhaimin ShihabOP15mo ago
I have two tables, users and user_details. now I have a form where I get name, email, password, and type. Now I want to save name, and type in user_details and other data in users. Give me a real example, please. Also, I want to show all data in a table. Thank you.
Vp
Vp15mo ago
It's easy, you define relationship then you call like make(user.name) for more details ref docs, i'm on phone rn
Muhaimin Shihab
Muhaimin ShihabOP15mo ago
there are two ways, 1. create relation and 2. lifecycle hooks. I understand this but how to get the form data in lifecycle hook or relation?
Want results from more Discord servers?
Add your server