Illuminate\Foundation\Testing\Concerns\ImpersonatesUsers::be PHP Method

be() public method

Set the currently logged in user for the application.
public be ( Illuminate\Contracts\Auth\Authenticatable $user, string | null $driver = null )
$user Illuminate\Contracts\Auth\Authenticatable
$driver string | null
    public function be(UserContract $user, $driver = null)
    {
        $this->app['auth']->guard($driver)->setUser($user);
        return $this;
    }
ImpersonatesUsers