original_string: public function impersonate(User $user, Impersonator $impersonator)
      {
          /** @var  \Arcanedev\LaravelImpersonator\Contracts\Impersonatable  $user */
          if ( ! $impersonator->start(auth()->user(), $user)) {
              $this->notifyDanger(
                  trans('auth::users.messages.impersonation-failed.message'),
                  trans('auth::users.messages.impersonation-failed.title')
              );
  
              return redirect()->back();
          }
  
          return redirect()->to('/');
      }
code: public function impersonate(User $user, Impersonator $impersonator)
      {
          /** @var  \Arcanedev\LaravelImpersonator\Contracts\Impersonatable  $user */
          if ( ! $impersonator->start(auth()->user(), $user)) {
              $this->notifyDanger(
                  trans('auth::users.messages.impersonation-failed.message'),
                  trans('auth::users.messages.impersonation-failed.title')
              );
  
              return redirect()->back();
          }
  
          return redirect()->to('/');
      }
code_tokens: public function impersonate ( User $ user , Impersonator $ impersonator ) { /** @var  \Arcanedev\LaravelImpersonator\Contracts\Impersonatable  $user */ if ( ! $ impersonator -> start ( auth ( ) -> user ( ) , $ user ) ) { $ this -> notifyDanger ( trans ( 'auth::users.messages.impersonation-failed.message' ) , trans ( 'auth::users.messages.impersonation-failed.title' ) ) ; return redirect ( ) -> back ( ) ; } return redirect ( ) -> to ( '/' ) ; }
docstring: Impersonate a user.
  
  @param  \Arcanesoft\Contracts\Auth\Models\User                 $user
  @param  \Arcanedev\LaravelImpersonator\Contracts\Impersonator  $impersonator
  
  @return \Illuminate\Http\RedirectResponse
docstring_tokens: Impersonate a user .