I started new project on Laravel and wanted to add 2 extra columns to User table (phone_number, position). But when I try to register I have this error:
SQLSTATE[HY000]: General error: 1364 Field 'phone_number' doesn't have a default value (SQL: insert into
users
(name
,password
,updated_at
,created_at
) values (Lidija, lidija@gmail.com, $2y$10$/BQju2korC4YOm.6yCb2i.sOoQQJTgzEyklrHPfJPF1XQwx86Vyky, 2020-10-09 15:35:36, 2020-10-09 15:35:36))
I did migrate tables. Maybe there is something wrong with input values in blade.php?
User model:
My User migration:
UserController:
Blade.php:
I did php artisan optimize
, didn't help. Also, I tried dd($request->all())
in the Store method to see what's there, but it showed nothing, just this error 1364 again.
What could be the problem?