Skip to content

Use for Boolean Fields #13

Description

@kohlerdominik

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions