Anyone Successfuly Upgraded to V3 with Stancl Tenancy for Laravel Tenant Identification Issue

Hi all, i am battling to upgrade to v3 with stancl for tenancy, has anyone successfully done so? The issue i am hitting is tenant identification when logging in (its trying to use central database instead of tenantdb) I have adde to my adminserviceprovider this middleware
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
InitializeTenancyByDomainOrSubdomain::class,
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
InitializeTenancyByDomainOrSubdomain::class,
but seems not to be working
15 Replies
ccc1516
ccc151616mo ago
Hi, i'm trying to start new project with V3 and Stancl Tenancy, the problem that i found is here: i can login / logout and view the corret data for my tenant, but i'm getting this error: Livewire page component layout view not found: [components.layouts.app] I got this error only in the admin panel of the tenant, in the main domain i got 0 errors.
ccc1516
ccc151616mo ago
Some screen
No description
No description
No description
Dennis Koch
Dennis Koch16mo ago
I think that's unrelated to tenancy and was some different issue?
Dennis Koch
Dennis Koch16mo ago
@cvc_web I got it working on my app, but I am still on Filament v3-beta. You might need to add the middelware for Livewire routes: https://livewire.laravel.com/docs/installation#configuring-livewires-update-endpoint
Laravel
Installation | Laravel
A full-stack framework for Laravel that takes the pain out of building dynamic UIs.
ccc1516
ccc151616mo ago
i think that it's a problem with livewire 3 and tenancy. For example for livewire 2, i should editing the middleware_group in the config file, but now this middleware_group dosn't exist anymore in livewire 3.
Dennis Koch
Dennis Koch16mo ago
See my last answer.
ccc1516
ccc151616mo ago
Edit: i put the code with web Universal and initiate tenant middleware and all work well
Wiin
Wiin16mo ago
I have it working fine too, the problem in my case was that I was using the old livewire 2 configuration, same problem as @cCc , doing this fixes it: https://livewire.laravel.com/docs/installation#configuring-livewires-update-endpoint
Laravel
Installation | Laravel
A full-stack framework for Laravel that takes the pain out of building dynamic UIs.
Wiin
Wiin16mo ago
Like this in my case: //AppServiceProvider.php Livewire::setUpdateRoute(function ($handle) { return Route::post('/livewire/update', $handle) ->middleware([ 'web', 'universal', InitializeTenancyByDomain::class, ]); });
nostrodamned
nostrodamnedOP16mo ago
yes updating livewire sorted it (I had old views in public folder)
KA
KA16mo ago
add layout template on your view folder and call it like following:
public function render()
{
return view('livewire.products.categories')->layout('layout.app');
}
public function render()
{
return view('livewire.products.categories')->layout('layout.app');
}
or you can set as you want on the livewire.layout config not lucky! its not working for me 😦
nostrodamned
nostrodamnedOP16mo ago
did you check vendor folder under public?
KA
KA16mo ago
No. Can you please tell me what to check? I tried with fresh installation.
Mohamed Melouk
Mohamed Melouk15mo ago
no, I solved the middleware thing but the assets path is still missed up and I can't set 'asset_helper_tenancy' => false it will break all my website images I don't know why this affect filament assets!!!
Dennis Koch
Dennis Koch15mo ago
Because it’s a global override. See the other thread you commented
Want results from more Discord servers?
Add your server