jeudi 1 septembre 2016

Laravel 5.1: Null field being converted to blank in the function create

The Model.php has the following function:

public static function create(array $attributes = []) { $model = new static($attributes); $model->save(); return $model; }

The attributes parameter has null value for each field when they are not filled by the user. However, after call new static($attributes) one field is converted to "". I do not understand. Even when all fields are null, only one field is converted to "" (blank).

I do not want this convertion to blank. Anyone knows what is happening in this case?

Thanks. Best regards.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire