Models
Creating models
A model represents a content type of your Prismic environment. Each model should extends the abstract base model from the package.
For example; We have a content type called 'page':
This base setup is already enough to query the api for your documents.
Alter fields
Your model can implement methods that are called when a field is called. For example a 'title' field can be changed like:
You model will now use getTitleField
when $page->title
is called.
Local scopes
Local scopes like used in the normal Eloquent models are also available.
Camel case fields
You can access your model field by camelCase. Prismic Eloquent will automatically change camel case to snake case since this is the default in Prismic.
For example:
Last updated