mysql - Laravel 5.4 save NULL to database not working -


the following code results in empty value inside database , when out of database empty string.

$customer->update(['company' => null]); 

you should consider 3 things:

1) make sure company column in nullable in table. if it's not won't possible put null in there.

2) make sure have in $fillable property of customer model column company

3) verify don't have mutator in customer model - verify don't have setcompanyattribute method might change value automatically empty string if it's set null


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -