Entity Object
#
IntroductionEntity object is the main resource of Architect. You can easily construct new entities by
sending out POST
request to the defined route specifying the name of the entity in plural.
If the entity that you want to store inside the database is a todo for example, the route pointing
to the collection of all todos would be /api/todos
. This way Architect knows that it should store
that in a specific table created at the time of first use.
note
Entity is a single resource stored inside the database
note
Collection is a set of entities that will be manipulated through the API. Ex todos
or cars
#
Anatomy of the Entity ObjectDue to flexible nature of Architect, Entity Object can be anything you imagine. After you create your
entity by passing in a JSON
via POST
request, Architect will return a unique ID
for that resource
alongside with utility fields like created_at
and updated_at
.
If we would define our POST
request like this:
And call that createTodo
method with Get come milk passed to it.
This would be the response generated for us By Architect.