-
I have a tiny int column, created by this migration $table->tinyInteger('bulk_status')->default(0); So I tried following this documentation https://nova.laravel.com/docs/4.0/resources/fields.html#boolean-field I added the following to my User.php with the following issues. All values show as green/true: Boolean::make('Bulk Status'), All values show as red/false: Boolean::make('Bulk Status')
->trueValue(1)
->falseValue(0), However, I know it's detecting the field correctly, because this works.. but is uglier in the list. Select::make('Bulk Status')->options([
'0' => 'Inactive',
'1' => 'Active',
]), I tried using strings for the boolean as well with '1' and '0', with no change. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Realized I had this function left over from a Laracasts tutorial from a few months ago. public function getBulkStatusAttribute($bulk_status): string
{
return $bulk_status === 1 ? 'Active' : 'Inactive';
} That was breaking it. Stupid there's no way to delete the discussions lol. |
Beta Was this translation helpful? Give feedback.
Realized I had this function left over from a Laracasts tutorial from a few months ago.
That was breaking it.
Stupid there's no way to delete the discussions lol.