Closed kylekz closed 6 years ago
Just updated to 5.2 beta and the issue still persists. Other than hardcoding changes to Spark itself, I haven't found any solution either.
So...
A solution would be to add the Tenancy service provider inside config/app.php
so that it is registered before the Spark service provider (automatically) and to enable early/eager identification so that the event is being listened on.
There are alternatives to this solution I might suggest but they would require changes to the package.. I'd love to hear first whether my hunch was correct and the above solves your issue.
Added tenancy to the don’t discover in composer.json, added tenancy’s provider above Spark, enabled early identification, cleared caches etc etc. Still getting the same error.
Edit: Updated stacktrace: https://gist.github.com/xKairu/231f7a0c08e1929c7d54f8f82d78069a
This should have been fixed, please confirm and re-open in case it still causes troubles.
Description
Installed Laravel Spark, added its models to the
force-tenant-connection-of-models
array and they're still forcing themselves onto the system connection. May not be strictly Spark related, it's just what I'm running into issues with. Talking with luceos on Discord, we've tried:print_debug_backtrace
, results in nothing.boot()
toregister()
inHyn\Tenancy\Providers\Tenants\EventProvider
, results inReflectionException (-1) Class cache does not exist
We were thinking it may be relation related, but where the code is failing, it's accessing the Notification model and querying it directly rather than off a relation.
Actual behavior
Forces itself to the system connection where the table doesn't exist. See error log below.
Expected behavior
Should use the tenant connection to find the correct prefixed table.
Information
tenancy.php config
https://gist.github.com/xKairu/734a1258c87d5cd2a2909dd0e735fed1
webserver.php config
https://gist.github.com/xKairu/59da2d10bfcd2e7db12bb8d235067c27
Error log
https://gist.github.com/xKairu/2d2425fa7f8fcecd6a015f572621e58b