© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
SelectFilter with relationship query - Filament
F
Filament
•
2y ago
•
9 replies
Rinkesh
SelectFilter with relationship query
I have used SelectFilter and applying query like this but not getting selected value
$acd
_id inside where
.
S
e
l
e
c
t
F
i
l
t
e
r
:
:make
(
'academic
_id
'
)
-
>label
(
'Academic Year
'
)
-
>options
(fn
(Get
$get
)
: array
=
>
A
c
a
d
e
m
i
c
Y
e
a
r
:
:all
(
)
-
>where
(
'status
'
, 1
)
-
>pluck
(
'month
_label
'
,
'id
'
)
-
>all
(
)
)
-
>query
(function
(Builder
$query
, array
$data
)
: Builder
{
return
$query
-
>when
(
$data
[
'value
'
]
,
fn
(Builder
$query
,
$acd
_id
)
: Builder
=
>
$query
-
>with
(
'academic
'
)
-
>whereHas
(
'academic
'
, function
( Builder
$query
,
$acd
_id
)
{
$query
-
>where
(
'academic
_id
'
,
'
=
'
,
$acd
_id
)
;
}
)
)
;
}
)
Solution
try
->whereHas('academic', function(Builder $query) use ($acd_id) {
->whereHas('academic', function(Builder $query) use ($acd_id) {
Jump to solution
Filament
Join
A powerful open-source UI framework for Laravel • Build and ship apps & admin panels fast with Livewire
20,181
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Recent Announcements
Similar Threads
SelectFilter with relationship help...
F
Filament / ❓┊help
2y ago
SelectFilter relationship field
F
Filament / ❓┊help
3y ago
SelectFilter with options from custom query
F
Filament / ❓┊help
3y ago
SelectFilter unique/distinct relationship value
F
Filament / ❓┊help
2y ago