Protected Pages
You may need to add a hard-coded reference to a page with a specific slug in your code. To try and provide some protection from users inadvertently changing the slug on the page and breaking the site, you are able to specify slugs that should not be able to be changed once created. This functionailty if provided using an Eventy filter on the crud.edit.configAfterSetItem and crud.update.configAfterSetItem.
On your admin page controller, you should fill in the $disabled_slugs array:
/**
* List of slugs to prevent editing on.
*
* @var array
*/
protected static $disabled_slugs = [
'home',
];
Any page with a slug in this array will have it's slug field set to disabled in it's edit page. If the current user is a superuser, this restriction is ignored.
Disabling the feature
This feature is enabled by default. If you would like to disable this feature entirely, you can add the following to your admin page controller.
/**
* Whether to use the disabled slugs feature
*
* @var boolean
*/
protected $should_disable_slugs = false;