webpatser/laravel-uuid

many to many, uuid not auto generated on pivot table

kocedt opened this issue · 1 comments

users -> user_agencies -> agency
cannot create user from agency->users()->create(...)

public function users() {
return $this->belongsToMany('App\User', 'user_agencies', 'agency_id', 'user_id');
}

Illuminate\Database\QueryException : SQLSTATE[HY000]: General error: 1364 Field 'id' doesn't have a default value (SQL: insert into user_agencies (agency_id, user_id) values (e8c92d00-b27d-11e8-94d6-39aa45ecfc56, e8dea9f0-b27d-11e8-8c75-8d673446facb))

Could you show your table? Apparently it is complaining that you are not entering a field called ID in your insert.