Skip to content
This repository was archived by the owner on Dec 11, 2023. It is now read-only.

Conversation

elcapo
Copy link

@elcapo elcapo commented Oct 25, 2022

By trying to save an existing course with the previous version of save, an integrity exception was thrown. This could have been solved by telling Eloquent that the record already exists with $model->exists = true; but by doing so, we would break inserts.

To fix the issue without having to write separated methods for inserts and updates, we used Eloquent's updateOrCreate.

By trying to save an existing course with the previous version of `save`, an integrity exception was thrown. This could have been solved by telling Eloquent that the record already exists with `$model->exists = true;` but by doing so, we would break inserts.

To fix the issue without having to write separated methods for **insert**s and **update**s, we used Eloquent's `updateOrCreate`.
@elcapo elcapo closed this by deleting the head repository Dec 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant