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.
@mathijsqdrop I see. I don't use Tenancy and I don't think I'll be able to setup a test environment to test this anytime soon. Could you please open a PR with the solution that worked for you?
I have a Multi-tenant environment based upon https://tenancyforlaravel.com/saas-boilerplate/ and https://github.com/archtechx/tenancy
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 thegetConnectionName
function is called on the model, which does return the right connection name.Permissions.php
and Roles,php
This fixes the problem (at least for me) 😄