You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got a Resource Page where I want to add some Raw query syntax based upon the value of the current selected table filter.
The filter itself works just fine & the url of the page gets updated with the current filter values
eg https://mysite/.../mypage?tableFilters[activity_id][value]=12
in the getEloquentQuery function I can't retrieve the current value. $id gets the value Closure($livewire) {#2479 ▼ // app/Filament/Resources/MyResource.php:30 class: " App\Filament\Resources \ MyResource" }
How can I resolve this?
` public static function getEloquentQuery(): Builder
{ $id = (fn ($livewire) => data_get($livewire->tableFilters, 'activity_id.value') ?? 0);
return parent::getEloquentQuery()
->select('id', 'name', \DB::raw("$id as test"));
}
public static function table(Table $table): Table
{
return $table
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Package
Table builder
Package Version
v3.2.98
How can we help you?
I've got a Resource Page where I want to add some Raw query syntax based upon the value of the current selected table filter.
The filter itself works just fine & the url of the page gets updated with the current filter values
eg https://mysite/.../mypage?tableFilters[activity_id][value]=12
in the getEloquentQuery function I can't retrieve the current value.
$id gets the value
Closure($livewire) {#2479 ▼ // app/Filament/Resources/MyResource.php:30 class: " App\Filament\Resources \ MyResource" }
How can I resolve this?
` public static function getEloquentQuery(): Builder
{
$id = (fn ($livewire) => data_get($livewire->tableFilters, 'activity_id.value') ?? 0);
public static function table(Table $table): Table
{
return $table
`
Beta Was this translation helpful? Give feedback.
All reactions