Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use for Boolean Fields #13

Open
kohlerdominik opened this issue Aug 11, 2020 · 0 comments
Open

Use for Boolean Fields #13

kohlerdominik opened this issue Aug 11, 2020 · 0 comments

Comments

@kohlerdominik
Copy link

kohlerdominik commented Aug 11, 2020

Hi all

The Indicator Field seems not work for a boolean field, as I guess it's not it's intended behaviour. However, it would be great if this would work with boolean fields, too, as I think boolean fields in Nova lack of options to customize.

I can make it work with boolean with a computed field:

Indicator::make('Some Bool', function () {
    return (int) $this->someBool;
})->labels([
    0 => 'inactive'
    1 => 'active'
])

but this takes away "sortable". Is there a better place to cast the boolean?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant