How to solve the Laravel Eloquent Duplicate issue
Integrity constraint violation: 1062 Duplicate entry '8' for key 'PRIMARY'
protected $primaryKey = 'user_id';
Now that you have added your primary key in your model, try to reuse the UpdateOrCreate method, you should not receive another duplication issue.
We decided to post this fix as many seem to struggle with this when using Laravel!
Enjoy