| Q | A
| ----------------- | ---
| Bug? | yes
| New Feature? | no
| Framework | Laravel
| Framework version | 6.x.y
| Package version | 9.x.y
| PHP version | 7.3.y
When updating a pivot table without an id column it throws an error that the auditable_id cannot be null
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'auditable_id' cannot be null
Insert without auditable_id for pivot tables
calling $model->relationship()->updateExistingPivot($relationship_id, $data) in a controller throws the error SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'auditable_id' cannot be null
Update migration to nullableMorphs('auditable') however this results in null values being recorded for old_values. Needs to record old_values through relationship instead of by pivot id
Update migration to nullableMorphs('auditable') however this results in null values being recorded for old_values.
Instead, you can add auto-incrementing primary key and public $incrementing = true; on pivot
Most helpful comment
Instead, you can add auto-incrementing primary key and
public $incrementing = true;on pivot