Skip to content

Creating and saving

DavidDuwaer edited this page Sep 22, 2017 · 9 revisions

Query building

Saving

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()

  1. If artist has an ID set (i.e. artist.getId() would not return null), then this would yield an HTTP PATCH query. If no Artist with the ID is found in the backend, this query would fail.
  2. If artist does not have an ID set, this query would yield an HTTP POST query, creating a new Artist in the backend.

The response object

Clone this wiki locally