Bdev
Bdev
FFilament
Created by ocram82 on 4/10/2024 in #❓┊help
filters on same relationship
the relationship method will also require second parameter which is the property of relationship you want to filter by: ->relationship('phisycalProfile', 'eye_color') for example.
6 replies
FFilament
Created by ocram82 on 4/10/2024 in #❓┊help
filters on same relationship
you can then specify in the select filters relationship they should apply to by using ->relationship('phisycalProfile')
6 replies
FFilament
Created by ocram82 on 4/10/2024 in #❓┊help
filters on same relationship
Hi ocram82, I believe select filters need to have distinct names provided to their make() method as internally data of the first Select Filter called phisycalProfile will be overwritten by the second one. best is to call them based on what data they should hold, then they will both display:
SelectFilter::make('eye_color')
->options( //rest of code here),
//and
SelectFilter::make('hair_color')
->options( //rest of code here)
SelectFilter::make('eye_color')
->options( //rest of code here),
//and
SelectFilter::make('hair_color')
->options( //rest of code here)
6 replies
FFilament
Created by Tjiel on 4/10/2024 in #❓┊help
How can I refresh the page after a filter is changed
Great glad that you have sorted it out thats roughly what i meant with using listeners:)
8 replies
FFilament
Created by Tjiel on 4/10/2024 in #❓┊help
How can I refresh the page after a filter is changed
You could reach for laravel redirect method maybe something like this:
return redirect()->to(AssetResource::getUrl('list`));

return redirect()->to(AssetResource::getUrl('list`));

8 replies
FFilament
Created by Tjiel on 4/10/2024 in #❓┊help
How can I refresh the page after a filter is changed
Hi Tjiel, I had similar problem try to inject current livewire component to your filter closures then do $livewire->dispatch('eventName') Remember to register listener in your component and pass it $refresh like this:
protected $listeners = [
'eventName' => $refresh,
];
protected $listeners = [
'eventName' => $refresh,
];
8 replies