Illuminate\Contracts\Container\BindingResolutionExceptionTarget class [universal] does not exist.
I have a small problem that when I try to log into the filament admin panel I get this, taking into account that I just installed it for a new project
Target class [universal] does not exist.
Solution:Jump to solution
I did it again from scratch and it worked, maybe I made a bad configuration of my tenancy
26 Replies
Can you share the flare exception?
Sound like you are using a universal middleware or something that doesn’t exist
I literally did what the documentation asks for, I watch videos about it and it doesn't give them this error, but they use Laravel 10.* I use Laravel 11 since this project requires a tenancy structure
The login tab works, only the tab when you log in does not work
So I guess the issue isn’t Filament but you multi tenancy setup? I guess you are using stancl/tenancy?
yes
Did you enable UniversalRoutes?
The issue is that I want to use subdomains due to the project requirement, not a universal route, could it be done that way with filament?
You still need the universal routes for Livewire I think.
You still have subdomains.
No, I have already configured the tenancy issue, the only thing missing is the part of the administration panel that would be for creating new tenants, and managing them there, from the main domain, and I was thinking of doing it with filament
The error sounds like you are using the
universal
middleware without enabling the feature.
Are you using the universal
middleware anywhere?nop no, I have not used or enabled the universal path theme
But it seems to be used somewhere. Did you search your code base for
universal
?it is not allowed
'features' => [
// Stancl\Tenancy\Features\UserImpersonation::class,
// Stancl\Tenancy\Features\TelescopeTags::class,
// Stancl\Tenancy\Features\UniversalRoutes::class,
// Stancl\Tenancy\Features\TenantConfig::class, // https://tenancyforlaravel.com/docs/v3/features/tenant-config
// Stancl\Tenancy\Features\CrossDomainRedirect::class, // https://tenancyforlaravel.com/docs/v3/features/cross-domain-redirect
// Stancl\Tenancy\Features\ViteBundler::class,
],
Without filament the subdomains and main domains work correctly, but the issue is that when I want to use filament, when I start the session I get that error, or else I would have to do everything manually
Here it works wonderfully, but when starting the session it is the issue
try {
$reflector = new ReflectionClass($concrete);
} catch (ReflectionException $e) {
throw new BindingResolutionException("Target class [$concrete] does not exist.", 0, $e);
}
this part that shows the error
So what happens if you enable that feature?
If I enable it, nothing changes, in the error, it would only work on the main domain, instead of several subdomains
Is it possible to work with Laravel tenancy? or are they not combatable?
It is definetly possible. Probably just some misconfiguration
It should work if you follow the steps for the Livewire configuration. Someone did a write up but I cannot find it right now.
but according to the livewire documentation I followed it and it worked only on the livewire and the breeze correctly, but when it came to using filament it only gave me an error
Did you adjust anything for Filament itself?
Because Filament isn't just Livewire, but the same setup rules need to be done there too. E.g. middlewares etc.
No, in fact I didn't adjust anything when installing filament, I had first installed livewire and followed its documentation in Laravel tenancy, but I didn't edit anything about filament because nothing came out of it
<?php
use Illuminate\Support\Facades\Route;
// routes/web.php, api.php or any other central route files you have
foreach (config('tenancy.central_domains') as $domain) {
Route::domain($domain)->group(function () {
//imprimir vista welcome
Route::get('/', function () {
return view('welcome');
});
});
}
To work on the main domain it should be like this, is there something that is put in web route?
Oh you only want on central domain? No then I don’t think you need to do that
Now it doesn't even work well with breeze, it gives the same error
the only thing that works with is jetstream
@Dennis Koch thanks for your time bro, I was able to solve the error now
Solution
I did it again from scratch and it worked, maybe I made a bad configuration of my tenancy
Glad you figured it out.