In order to make sure that it is clear that tables live in the Central or Tenant "domain" I have to prefix all Central-related tables.
This causes the Validator
to guess the wrong connection, because of the prefix.
In order to combat this, we can either pass the class name to the Validator, so the getConnectionName
function is called on the model, which does return the right connection name.
Text::make(__('nova-permission-tool::permissions.name'), 'name')
->rules(['required', 'string', 'max:255'])
->creationRules('unique:'.config('permission.models.permission'))
->updateRules('unique:'.config('permission.models.permission').',name,{{resourceId}}'),
Text::make(__('nova-permission-tool::roles.name'), 'name')
->rules(['required', 'string', 'max:255'])
->creationRules('unique:'.config('permission.models.role'))
->updateRules('unique:'.config('permission.models.role').',name,{{resourceId}}'),
PHP 8.1.5
Laravel Framework 9.10.1
Laravel Nova v3.32.0
kiritokatklian/nova-permission v3.2.2