I have an accessor on my model for a boolean column:
public function getActiveAttribute($value)
{
if ($value == 0) {
return "No";
} else {
return "Yes";
}
}
The problem I am having is the corresponding form input, a radio button, does not have either options selected when I go to a create or edit view. I could amend the form so the values of the radio buttons are "Yes" and "No" and then write a mutator for the same field.
Is there a better way to do it?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire