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

actingAs() public method

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