Martin Bojmaliev
Martin Bojmaliev
FFilament
Created by Martin Bojmaliev on 5/10/2024 in #❓┊help
Using ReplicateAction on many to many RelationManager
Using ReplicateAction in RelationManager of type many to many replicates the model and not the relation? For example I have: Form CustomField ManyToMany relation between them. When using ReplicateAction I want to connect Form with CustomField again and not to create another CustomField
2 replies
FFilament
Created by Martin Bojmaliev on 2/20/2024 in #❓┊help
Using Spatie Translatable
No description
7 replies
FFilament
Created by Martin Bojmaliev on 10/31/2023 in #❓┊help
Filter doesn't work when having `having` in the query
In UserResource i want to filter users that have more then X number of device tokens. I'm doing something like:
Tables\Filters\Filter::make('is_blocked')
->label('Blocked users')
->query(fn ($query) => $query
->withCount('deviceTokens')
->having('device_tokens_count', '>=', 4)
)
->toggle(),
Tables\Filters\Filter::make('is_blocked')
->label('Blocked users')
->query(fn ($query) => $query
->withCount('deviceTokens')
->having('device_tokens_count', '>=', 4)
)
->toggle(),
But when I activate the filter the SQL query that's being sent to database doesn't seems to be changed. Normally in Laravel thinker when I write something like:
User::query()->withCount('deviceTokens')->having('device_tokens_count', '>=', 4)->get()
User::query()->withCount('deviceTokens')->having('device_tokens_count', '>=', 4)->get()
It works fine. Any ideas ?
4 replies