Laravel 5.4 field doesn't have a default value

后端 未结 7 800
执念已碎
执念已碎 2020-12-14 06:37

I am having this error and none of the googled result i checked is similar to my problem.

I have an application with class Deal, User, and Matches

A deal has

7条回答
  •  不思量自难忘°
    2020-12-14 07:29

    Since it was a unique field in my case, I could not make it nullable.

    For me, I had an empty constructor which was causing the issue don't know why. Please comment if anyone knows the reason.

    public function __construct(){
    
    }
    

    Commenting/removing it resolved the issue.

提交回复
热议问题