F
Filament14mo ago
bflip

Add global scope within Filament

I found this in docs:
public static function getEloquentQuery(): Builder
{
return parent::getEloquentQuery()->where('is_active', true);
}

https://filamentphp.com/docs/3.x/panels/resources/getting-started#customizing-the-resource-eloquent-query
public static function getEloquentQuery(): Builder
{
return parent::getEloquentQuery()->where('is_active', true);
}

https://filamentphp.com/docs/3.x/panels/resources/getting-started#customizing-the-resource-eloquent-query
But where am I adding that? I get errors adding to a resource.
Solution:
nvm, fixed
Jump to solution
2 Replies
bflip
bflipOP14mo ago
I basically just want to scope by user ID:
->where('user_id', auth()->id()
->where('user_id', auth()->id()
Just for filament pages
Solution
bflip
bflip14mo ago
nvm, fixed
Want results from more Discord servers?
Add your server