-
Notifications
You must be signed in to change notification settings - Fork 23
Creating and saving
DavidDuwaer edited this page Sep 22, 2017
·
9 revisions
To save a Coloquent model, e.g. an object artist of type Artist, do
artist.save();This query may do two things, based on if artist has an ID set prior to calling save()
- If
artisthas an ID set (i.e.artist.getId()would not returnnull), then this would yield an HTTP PATCH query. If noArtistwith the ID is found in the backend, this query would fail. - If
artistdoes not have an ID set, this query would yield an HTTP POST query, creating a newArtistin the backend.