TextInput integer save 0 as null
here is my code
if user put 0 into it, it saved as null instead of '0'
Solution:Jump to solution
```php
public function getAmountAttribute($value)
{
return $value ?? 0;
}...
5 Replies
->default(null)
still save as null
Set a default cast if you want it to save as 0 using an accessor?
Solution
On your model.
thank youu