invisnik / laravel-steam-auth

Laravel Steam Auth
MIT License
172 stars 67 forks source link

SQLSTATE[HY000]: General error: 1364 Field 'avatar' doesn't have a default value (SQL: insert into `users` (`updated_at`, `created_at`) values (2018-05-04 06:19:07, 2018-05-04 06:19:07)) #102

Closed ImWuX closed 6 years ago

ImWuX commented 6 years ago

Keep getting this. Please Help. IDK what's wrong but it's not inserting the steamId, avatar etc.

Gummibeer commented 6 years ago

https://stackoverflow.com/questions/15438840/mysql-error-1364-field-doesnt-have-a-default-values

Even if this error isn't related to this package - I try to solve it.

Your problem is that you've added a column avatar to the users table - this column isn't nullable and has no default value but you try to save a user without an avatar. If you set the avatar on the user model but it's not saved the problem could be related to the eloquent mass assignment rules. To fix this simply add the avatar column to the $fillable property in the user model class.