Custom page with custom table
I'm working in a personal project where i want to feed my table with api data. I have already tried to use sushi, however it has a limitation when i talk about a paginated api. So the alternative i found was build a custom page, host a custom table and try to navigate through the api with it. But at this point i'm not progressing, someone can help me with livewire table content or any sort of help?
This is my project at github:
https://github.com/eduardoximenes/filament-app.git
GitHub
GitHub - eduardoximenes/filament-app
Contribute to eduardoximenes/filament-app development by creating an account on GitHub.
Solution:Jump to solution
I've finished the custom table. At this point, i don't think i need sushi anymore. Let's see what happens next...
11 Replies
if anyone need this just acess the github, it´s now working.
I'll have a look at the code and let you know what I can find.
thank you
This seems to be a very hard limitation. Unfortunately I haven't found any workaround available. After reading this article, I would take the sync approach, where you come up with a way to sync API data to local models.
https://laraveldaily.com/post/filament-load-table-data-from-3rd-party-api
Laravel Daily
Filament: Load Table Data From 3rd Party API
do you have more tips about the sync way?
i honestly dont know to implement
I can only offer high level advice since it's not something I've implemented. But the way I would go about it (without knowing anything about the API) would be to come up with a scheduled job that pings the API and collects all the data from every page. The difficulty here, is to be able to compare the incoming records with the ones already stored and make sure to update the ones that need updating or delete the ones that don't exist. A nuclear way would be to simply wipe out the table on every sync, but then you need to think about performance and possible down times. Again, these are just high level concepts.
With regards to the compare the incoming records suggested by @tuto1902 I would have in the tables that I'm syncing a hash column. So you get the data from the api, hash it using md5 for example, and then compare it with the hash value you saved last time. If the hashes do not match then it means it's been updated.
That's a great idea!
thank you @tuto1902 and @Abel Cobreros!
Solution
I've finished the custom table. At this point, i don't think i need sushi anymore. Let's see what happens next...