Skip to content

Instantly share code, notes, and snippets.

@nasrulhazim
Last active May 14, 2019 23:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nasrulhazim/b442dd44f706c32303d228e97443d325 to your computer and use it in GitHub Desktop.
Save nasrulhazim/b442dd44f706c32303d228e97443d325 to your computer and use it in GitHub Desktop.
Impersonate Icons
<div class="btn-group" role="group" aria-label="actions">
@if(auth()->guard('api')->user()->can('update-' . $permission))
<a href="{{ route('users.edit', $user->id) }}" class="btn btn-sm btn-outline-primary" title="{{ __('View') }}">
<i class="far fa-edit"></i>
</a>
@endif
{{-- Don't display in production, and also if the current logged in user don't have permission to update --}}
@if('production' != app()->environment() && auth()->guard('api')->user()->can('update-' . $permission))
<a href="{{ route('impersonate', $user->id) }}" class="btn btn-sm btn-primary" title="{{ __('Impersonate') }}">
<i class="far fa-user"></i>
</a>
@endif
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment