Need Help in Table builder and Relationship

I have 2 Models A and B where A is the Parent and B is the Child and they have a relationship of one to many. However, the problem was raised when Model B had 7k data and Model A had 100+ data. It's like 1 Model A has 2 or 3 records related to Model B but both the data are fetched from API. Show Model B data on the view page of Model A as Relationship Manager. I need some suggestions or ideas on how to Fetch Model B's data of that Current Modal A on the view page only. I want to show Data in table format only be it the Record is 2 or 50. And Also the response of API has pagination. I have Attach The Image of the API Response that I got.
No description
3 Replies
Rohan97
Rohan977mo ago
Hello Grishma, I hope you are doing well. After seeing the details, It looks like you want to show related tables B's data against A table record. You can check relation manager in filament to do so. LINK: https://filamentphp.com/docs/3.x/panels/resources/relation-managers#creating-a-relation-manager
Grishma Patel
Grishma PatelOP7mo ago
Hi Rohan, Yes, I'm doing well. I hope you are doing well. I have already used Filament Relation Manager. But as I Have used API every time I view the view page on Model A it first goes to Model B to fetch the all data then it sets its data and to load data 7k takes a load of time (More than min).
Rohan97
Rohan977mo ago
May I know why API is used and how it is feeding data to the relation manager? If you are using paginate() in the fetch API then this shouldn't happen.
Want results from more Discord servers?
Add your server