We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hey,
in my user list I dont want to show the Impersonate button for admins. At the moment I do this:
@if((Auth::user()->id !== $user->id) && ($user->canBeImpersonated())) <a href="{{ route('impersonate', ['id' => $user->id]) }}" class="btn btn-xs btn-warning">Impersonate</a> @endif
Unless I miss something, I think such a helper is a nice addition to this package.
The text was updated successfully, but these errors were encountered:
Hi.
Did you add the trait Impersonate to your user model ? Did you overwrite the canBeImpersonated() method ? How ?
Sorry, something went wrong.
Yes, I have the trait and the method overridden like so
/** * @return bool */ public function canBeImpersonated() : bool { return !$this->isAdministrator(); }
Just to be clear, my code above works as intended. I just thought it would be nice to have a blade helper @canBeImpersonated for that.
@canBeImpersonated
Ah sorry, i read too fast..
It's a good idea, if you want do a pull request. Otherwise, we will do it ourselves on the occasion
No branches or pull requests
Hey,
in my user list I dont want to show the Impersonate button for admins. At the moment I do this:
Unless I miss something, I think such a helper is a nice addition to this package.
The text was updated successfully, but these errors were encountered: