Skip to content
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

Trapped in exception when impersonating soft-deleted user #71

Open
JasperTey opened this issue Feb 25, 2024 · 1 comment
Open

Trapped in exception when impersonating soft-deleted user #71

JasperTey opened this issue Feb 25, 2024 · 1 comment

Comments

@JasperTey
Copy link

JasperTey commented Feb 25, 2024

I attempted to impersonate a soft-deleted user, which ends up trapping me in the following exception:

Filament\FilamentManager::getUserName(): Argument #1 ($user) must be of type Illuminate\Database\Eloquent\Model|Illuminate\Contracts\Auth\Authenticatable, null given

in reference to

<x-filament-impersonate::banner/>

I understand why this is probably happening; the intended $user is not being hydrated ->withTrashed() applied. Where exactly do I go to customize the banner, given that in the current version, it is being injected via a render hook? i.e., I did not place x-impersonate::banner into my master layout.

Temporary solution to break out of the exception was to set FILAMENT_IMPERSONATE_BANNER_RENDER_HOOK="" in .env so that I could log back in.

@fagnerdireito
Copy link

I have the same problem and I still haven't been able to solve it, in my case the User model doesn't have softdelete, it's the default laravel model, but I have a TenantScope.

If you find a solution you can share it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants