N
N
Nyakator2017-02-11 19:43:33
Laravel
Nyakator, 2017-02-11 19:43:33

Why doesn't the create() method work?

for some reason, creating a row in a table does not work with the create() method, but if you replace it with insert(), it works. Although in another model of the same project there is no such problem. The variables I pass are not empty, I checked with var_dump
Error:

SQLSTATE[HY000]: General error: 1364 Field 'post' doesn't have a default value (SQL: insert into `attitude` () values ​​())

The problem is in line 48
https://github.com/grigoryMovchan/zuihitsu/blob/ma...
In line 36 of this model the same function works
https://github.com/grigoryMovchan/zuihitsu/blob/ma...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nyakator, 2017-02-11
@Nyakator

It worked when I removed the constructor from the Attitude model.

A
Andrzej Wielski, 2017-02-11
@wielski

insert into `attitude` () values ​​()

You are passing an empty array, apparently

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question