vendredi 2 octobre 2015

How does Eloquent's create()/fill work()?

I trying to set records in a row by doing this in my Model:

protected $fillable = ['completeness','task'];
    public  function add($records) {
        $this->create($records);
        $this->save();
    }

Though all values are there yet I am getting this:

QLSTATE[23502]: Not null violation: 7 ERROR: null value in column "user_id" violates not-null constraint DETAIL: Failing row contains (5, 120, null, very detailed, null, null, null, null, null, null, 2015-10-02 07:12:05, 2015-10-02 07:12:05).

How does create() or fill() work?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire