jaap4677
jaap4677
FFilament
Created by jaap4677 on 8/23/2023 in #❓┊help
Populating SelectFilter with relation.
I have a belongsTo relation between my StudentProfile and my User model. From the StudentProfile resource I'm trying to populate a SelectFilter with available courseClasses. The courseClass has a belongsTo with the User. My selectfilter is setup like this:
SelectFilter::make('classname')
->relationship('user', 'class_id')
->label('Klas'),
SelectFilter::make('classname')
->relationship('user', 'class_id')
->label('Klas'),
This however, populates the select filter with all available class id's from the student resource. This way I have duplicates and also selecting one ID just filters one user. What would be the correct approach?
5 replies
FFilament
Created by jaap4677 on 7/6/2023 in #❓┊help
Set default value for colorpicker.
I'm trying to set some default values for my colorpicker but the all fall back to 'black'. Probably because the value is empty. My code looks like this:
ColorPicker::make('color_2')->label('Kleur 2')->default('#00AB9A')->reactive()
ColorPicker::make('color_2')->label('Kleur 2')->default('#00AB9A')->reactive()
Any ideas?
6 replies
FFilament
Created by jaap4677 on 5/8/2023 in #❓┊help
Update color values of SVG in real-time
I have an SVG image with three colors in a custom form field, and I have created three color pickers. I would like to know how to pass the reactive color picker values to my SVG form field, so that I can show the user how the final SVG image looks while tweaking the colors. This is the first solution that I have come up with, so I am open to better solutions!
8 replies