Entry configuration
Thomas van der Veen edited this page May 28, 2020
·
3 revisions
Entries are just like models. They are objects that contain properties with values. The developer will control which properties are available by configuration. Properties are configured by adding fields to the entry.
For an entry to be made available it first needs to be configured.
A typical entry configuration file would look something like this:
return [
'type' => 'post',
'name' => 'Post',
'table_columns' => ['title', 'author.name'],
'view' => 'entries.post',
'fields' => [
//
],
];
The configuration of your entries live in the default resources/entries
folder. However you are free the configure a different path by changing the cms.entries.path
configuration.
These are all the properties made available for configurating an entry.
Property | Type | Description |
---|---|---|
type |
string | required An identifier that helps the package to indentify what type of entry it is handeling. The value can be anything as long as it is unique to other entry types, it does not have to be the same as the filename. |
name |
string | The name of an entry will be used in the user interface to let the users identify what they are viewing, creating, editing or deleting. By default it will use the type value. |
single |
boolean | A boolean that indicates if there should only exist one of this entry type. |
table_columns |
array | An array of field keys that are used to render the table on the overview page. By default it will display the id , type , updated_at and created_at . Prefix a field key with entry_model: to retrieve the value from the entry model rather than from a field, eg: entry_model:id . |
view |
string | A reference to a blade file that is used to render when a user visits the url on which the entry is made available. This property is only required when the entry has a so called route_field_type . |
fields |
array | An array of fields configurations that should be made available to the entry as well as rendered in forms of the user interface. |