Krishzzi
Krishzzi
FFilament
Created by Krishzzi on 5/7/2024 in #❓┊help
get_class(): Argument #1 ($object) must be of type object, null given Filament::auth()
so, any solution..
11 replies
FFilament
Created by Krishzzi on 5/7/2024 in #❓┊help
get_class(): Argument #1 ($object) must be of type object, null given Filament::auth()
the test passed when I do like this.
$this->actingAs($user, $guard);
Filament::auth()->login($user);
$this->actingAs($user, $guard);
Filament::auth()->login($user);
So, when I do login with filament Filament::auth()->login($user); then the it gets Filament::auth()::user(), is actingAs() not enough for authenticate user
11 replies
FFilament
Created by Krishzzi on 5/7/2024 in #❓┊help
get_class(): Argument #1 ($object) must be of type object, null given Filament::auth()
I already pass the guard when actingAs like this..
beforeEach(function () {
$this->actingAs(Artist::factory()->create(), 'artist');
$this->actingAs(User::factory()->create(), 'web');
// other users
});
beforeEach(function () {
$this->actingAs(Artist::factory()->create(), 'artist');
$this->actingAs(User::factory()->create(), 'web');
// other users
});
etc. but still not working. I pass guard with individual user models while actingAs but Filament::auth::user() or any method chained to it fails for null
11 replies
FFilament
Created by Krishzzi on 5/7/2024 in #❓┊help
get_class(): Argument #1 ($object) must be of type object, null given Filament::auth()
I have 5 different panels with 5 different user models and guards. for each panel I have applied the specific guard with the authGuard function
$panel
->id('affiliate')
->path('affiliate')
->domain('demoaffiliate.jetpax.in')
->authGuard('affiliate')
->login()
$panel
->id('affiliate')
->path('affiliate')
->domain('demoaffiliate.jetpax.in')
->authGuard('affiliate')
->login()
how do I test this panels seperately because filament::auth() function does not work in test.
11 replies
FFilament
Created by Krishzzi on 5/7/2024 in #❓┊help
get_class(): Argument #1 ($object) must be of type object, null given Filament::auth()
Done
11 replies