F
Filament10mo ago
mamamia

How to use array in getTableQuery instead of Builder?

So i have an array somewhere, i want the table data is using the array instead of querying, how do i do that?
protected function getTableQuery(): Builder
{
// return Post::query();
return [["name"=>"t1"]["name"=>"t2"]] // something like this?
}
protected function getTableQuery(): Builder
{
// return Post::query();
return [["name"=>"t1"]["name"=>"t2"]] // something like this?
}
2 Replies
awcodes
awcodes10mo ago
You’ll need to use Sushi to make the array readable as an eloquent query. Here’s an article with an example. https://filamentphp.com/community/how-to-consume-an-external-api-with-filament-tables
Filament
How to consume an external API with Filament Tables by Leandro Ferr...
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
mamamia
mamamiaOP10mo ago
Thanks im gonna try that. one last question so i have filter select for "year", how to append it to the api url as param?
Want results from more Discord servers?
Add your server