-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use Backpack with Tenancy for Laravel #329
Comments
One time use both packages and don't remember to have problems. I think if needed will be good to have a section in the documentation "Integrating with other packages" like https://tenancyforlaravel.com/docs/v3/integrating not only for Tenancy for Laravel but for other packages. Finally end up creating a trait and call a function on each module ServiceProvider. The funcition is similar to backpack pro public function initializeBackpack()
{
// tell Backpack to automatically check the FIELDS directory in this package
app()->config['backpack.crud.view_namespaces.fields'] = (function () {
$fieldNamespaces = config('backpack.crud.view_namespaces.fields');
$fieldNamespaces[] = $this->moduleNameLower . '::fields';
return $fieldNamespaces;
})();
// tell Backpack to automatically check the COLUMNS directory in this package
app()->config['backpack.crud.view_namespaces.columns'] = (function () {
$fieldNamespaces = config('backpack.crud.view_namespaces.columns');
$fieldNamespaces[] = $this->moduleNameLower . '::columns';
return $fieldNamespaces;
})();
// tell Backpack to automatically check the BUTTONS directory in this package
app()->config['backpack.crud.view_namespaces.buttons'] = (function () {
$fieldNamespaces = config('backpack.crud.view_namespaces.buttons');
$fieldNamespaces[] = $this->moduleNameLower . '::buttons';
return $fieldNamespaces;
})();
// tell Backpack to automatically check the FILTERS directory in this package
app()->config['backpack.crud.view_namespaces.filters'] = (function () {
$fieldNamespaces = config('backpack.crud.view_namespaces.filters');
$fieldNamespaces[] = $this->moduleNameLower . '::filters';
return $fieldNamespaces;
})();
// tell Backpack to automatically check the WIDGETS directory in this package
app()->config['backpack.base.component_view_namespaces.widgets'] = (function () {
$fieldNamespaces = config('backpack.base.component_view_namespaces.widgets');
$fieldNamespaces[] = $this->moduleNameLower . '::widgets';
return $fieldNamespaces;
})();
} |
I've been struggling for the past few days to implement multi-tenancy using Laravel, Backpack v6, and multiple databases. I've attempted both subdomain and path-based tenant identification, but I haven't been able to make it work seamlessly. Here's my setup: I started with a fresh Laravel project with Breeze, and everything was functioning correctly. However, when I added Backpack CRUD to the project, I encountered several issues: Login Problems: I can only log in to the application using a user from the central database, and this user has access to both the central and tenant routes. Unfortunately, the tenant database doesn't have the same users, and attempting to log in with tenant-specific credentials doesn't work as expected. Access to CRUD Routes: Even after successfully logging in, I'm unable to access most of the CRUD routes provided by Backpack. The only route that seems to work is the blank dashboard. When I try to load any view from a CRUD controller, I encounter a 419 PAGE EXPIRED and redirected to login page again. I'm seeking advice and guidance on how to effectively implement multi-tenancy with Backpack v6 in my Laravel project. Any insights, suggestions, or solutions from the community would be greatly appreciated. Thank you in advance for your assistance! |
Someone just reported that they couldn't get Tenancy for Laravel working with Backpack. Which is weird... I heard some people had it working in the past.
We should probably investigate this. And if it's not easy to do, we should probably create a tutorial / howto / something, to make it easier for devs. It's a pretty popular package.
The text was updated successfully, but these errors were encountered: