Closed voidgraphics closed 5 years ago
Those fields are already prefixed.
The updated_at
field is automatically maintained by the Filesystem
Source and is therefore not displayed on the Nova edit page, meaning it cannot cause conflicts with the user's fields.
The two other fields, created_at
and title
are automatically prefixed with nova_page_
. Take a look at Pages\Resource
:
/**
* Get the base common attributes
*
* @return array
*/
protected function getBaseAttributeFields()
{
return [
Text::make('Page title', 'nova_page_title')
->rules(['required', 'string', 'max:255']),
DateTime::make('Page creation date', 'nova_page_created_at')
->format('DD-MM-YYYY HH:mm:ss')
->rules(['required', 'string', 'max:255']),
];
}
In the Template class (and in the JSON files also), these values are never filled in the attributes
array, meaning they're never mixed with the user's values.
In my opinion this issue can be closed, unless you have a specific problematic case in mind?
After some more testing, I'm closing this issue. Feel free to open it again if needed.
The
title
,created_at
andupdated_at
fields that automatically come with every template should be prefixed (for example__title
), so that it does not conflict or restrict the fields users can define.