Husniddin
Husniddin
FFilament
Created by Husniddin on 2/15/2025 in #❓┊help
Select filter attribute name by relation
I have an form select like that
Forms\Components\Select::make('teachers')
->label('Teachers')
->relationship('teachers')
->multiple()
->preload()
->searchable()
->required()
->options(
Teacher::with('user')->get()->pluck('user.name', 'id')->toArray()
)
Forms\Components\Select::make('teachers')
->label('Teachers')
->relationship('teachers')
->multiple()
->preload()
->searchable()
->required()
->options(
Teacher::with('user')->get()->pluck('user.name', 'id')->toArray()
)
So Teacher has relation user and I need to get label from user.name sho I wrote filter like that
Tables\Filters\SelectFilter::make('teachers')
->label('Filter by Teacher')
->relationship('teachers', 'user.name')
->multiple()
->preload()
->options(fn () => Teacher::with('user')->get()->pluck('user.name', 'id')->toArray())
Tables\Filters\SelectFilter::make('teachers')
->label('Filter by Teacher')
->relationship('teachers', 'user.name')
->multiple()
->preload()
->options(fn () => Teacher::with('user')->get()->pluck('user.name', 'id')->toArray())
for SelectFilter relationship 2nd param is required and if is not working with relations.
SQLSTATE[HY000]: General error: 1 no such column: user.name (Connection: sqlite, SQL: select distinct "teachers".* from "teachers" left join "speaking_club_teacher" on "teachers"."id" = "speaking_club_teacher"."teacher_id" order by "user"."name" asc)
SQLSTATE[HY000]: General error: 1 no such column: user.name (Connection: sqlite, SQL: select distinct "teachers".* from "teachers" left join "speaking_club_teacher" on "teachers"."id" = "speaking_club_teacher"."teacher_id" order by "user"."name" asc)
1 replies
FFilament
Created by Husniddin on 9/22/2023 in #❓┊help
I need to assign order to group.
Order has group_id and group has (HasMany) relationship I can assign order to group while editing it. after that if I open group resource I can get all orders using relationManager But I need to assign orders inside Order Resource too I tried using repeater but insted of assigning order it trying to create new order. How Can I do it?
1 replies
FFilament
Created by Husniddin on 8/11/2023 in #❓┊help
validation error
12 replies
FFilament
Created by Husniddin on 7/24/2023 in #❓┊help
Database notification to speciffic role
I need to send new notification to all managers As soon as some one reacts to new notification all other notifications must disappear How can I do it. is there any easy way to do it or should I need to do it manually?
1 replies
FFilament
Created by Husniddin on 7/24/2023 in #❓┊help
Notification actions
6 replies
FFilament
Created by Husniddin on 7/19/2023 in #❓┊help
Best way to validate Repeater
Trying to add repeater But how to validate for creating same record ?
4 replies
FFilament
Created by Husniddin on 7/17/2023 in #❓┊help
I'm having problem with changing styles
3 replies