F
Filament10mo ago
Rahaf

I can view two models in one Resources

I have two models one survey and another one is user info. I want to create one table with a survey and user info ?
6 Replies
Patrick Boivin
Patrick Boivin10mo ago
What would this Table look like? Are all the columns the same between both DB tables?
ThiNha
ThiNha7mo ago
I issued the same, I have a user table and an admin table. I want to show in one Resources.
toeknee
toeknee7mo ago
That's bad database schema, if you have separated them at the root level, you should have separate viewed data. You would add a relationship if they are different, but as Patrick asked how would you lay it out.
ThiNha
ThiNha7mo ago
Thank you, I will have separate viewed data.
toeknee
toeknee7mo ago
So you want two tables ? You could do a few things, create a single resource that does nothing and has relationship managers for both sets of users. You could join in the data on the eloquent query level and have filters for admin / user You can create a custom page which renders two tables as per the Filamentdocs
ThiNha
ThiNha7mo ago
Thank you, @toeknee
Want results from more Discord servers?
Add your server
More Posts
Visible and Hidden are not working on NavigationItem in NavigationBuilder arrayFor some reason, neither `hidden()` nor `visible()` is working! ```php public function panel(Panel $Check for uniqueness according to column title for grouped recordsHi I am trying to check for uniqueness of a Status Title - based on the model type. This is my code Read data into repeater based on selected filedthere is a products table with mark_id if i chose the mark_id i want to fill all the products with tBug in colorPicker in modalWhen the colorpicker is in a modal (editRecord) it is pretty unusable, you cant slide the color bar Make default select option other than the disabled optionhow to make a default option other than the disabled option. ```php Select::make('status') ->optHow to Set Grouped Rows as collapsed by defaultHi all again!! I have collapsible grouped rows on a table - how can we set them to be collapsed by dSQLSTATE[HY000]: General error: 1364 Field 'guardian_id' doesn't have a default valueI have a StudentResource and in form I am doing this: ```php Forms\Components\Select::make('guardianGetting error on custom list view..$resource must not be accessed before initializationI am getting this on a custom list page nothing on it yet just the table. ```Typed static property FHow to use defaultSort as orderByRaw?Hi, just want to ask how to achieve a defaultSort with a certain `status` like `invited, active, revCheckbox List DefaultCheckboxlist default() does not work in EditRecord. How to resolve it?