How to serialize the state #222
-
Hi, I have a state and every thing works fine, but for example if I have state class Canceled extends OrderState
{
public function name(): string
{
return __('Cancelled');
}
public function color(): string
{
return '#fff';
}
public function bgColor(): string
{
return '#111';
}
} and I want to use the state color or name in InertiaJs, what do I have to do? |
Beta Was this translation helpful? Give feedback.
Answered by
jeffreyvanhees
Jul 24, 2023
Replies: 1 comment
-
You can combine it with https://github.com/spatie/laravel-options (see states section) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
abublihi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can combine it with https://github.com/spatie/laravel-options (see states section)