Status color options
I have a status table where there are various status options for instance new , old, cold, taken etc . What I want the user have access to choose color of their own choice so what would be the right approch to do that using colorpicker or what else ? I've used colorpicker before but did not worked in this case. Can someone guide me on this please
16 Replies
If you’d explain why a color picker didn’t work maybe we could suggest something else.
On component
Database
it's all simple but its not working I don't know the exact issue either
its not catching the color or getting it in the db idk
For some reason its not working
Is the
color
column fillable?fillable as in ?
Fillable as in
$fillable
on your Eloquent Modelo yeah it is fillable
Wait. You just returned a form field for an Action? That should throw an exception and not just "not work" 🤔 Use an Action with a form that updates your model
so is that wrong ?
Yes, it is wrong. Otherwise it would work and I would suggest an alternative.
getTableActions
expects an array of Actions
. Check the Action docs: https://filamentphp.com/docs/3.x/actions/overview#what-is-an-actionok I'll check that thanks
Hello again, the colors are getting stored in database but it is not changing the color of status when I choose different colors for them why ?
What's the color format in the database?
Is the column even showing?
hex
its showing the column
I have the status column in leads and leads option has this setting where I have the permission to choose color for users
You’re storing the values as hex, so in your column you need to return the color as
Color::hex($value)
. Since they aren’t colors registered with filament.so what type of color format is registered with filament if not hex can I use some other type ?
what about this $table->string('color'); ?
That’s not mentioned in the docs. Don’t think that’s needed 🤔
:squint:
This is what I have in my lead resource
And this is what I have in app/Filament/Widgets/Options/Statuses.php
I have the status column in leads and leads option has this setting statuses where I have the permission to choose color for users
??