src/Concerns/ProvidesBrowser.php
public function browse(Closure $callback)
    {
        $browsers = $this->createBrowsersFor($callback);

        try {
            $callback(...$browsers->all());
        } catch (Exception $e) {
            $this->captureFailuresFor($browsers);

            throw $e;
        } catch (Throwable $e) {
            $this->captureFailuresFor($browsers);

            throw $e;
        } finally {
            $this->storeConsoleLogsFor($browsers);

            static::$browsers = $this->closeAllButPrimary($browsers);
        }
    }
public function browse(Closure $callback)
    {
        $browsers = $this->createBrowsersFor($callback);

        try {
            $callback(...$browsers->all());
        } catch (Exception $e) {
            $this->captureFailuresFor($browsers);

            throw $e;
        } catch (Throwable $e) {
            $this->captureFailuresFor($browsers);

            throw $e;
        } finally {
            $this->storeConsoleLogsFor($browsers);

            static::$browsers = $this->closeAllButPrimary($browsers);
        }
    }
public function browse ( Closure $ callback ) { $ browsers = $ this -> createBrowsersFor ( $ callback ) ; try { $ callback ( ... $ browsers -> all ( ) ) ; } catch ( Exception $ e ) { $ this -> captureFailuresFor ( $ browsers ) ; throw $ e ; } catch ( Throwable $ e ) { $ this -> captureFailuresFor ( $ browsers ) ; throw $ e ; } finally { $ this -> storeConsoleLogsFor ( $ browsers ) ; static :: $ browsers = $ this -> closeAllButPrimary ( $ browsers ) ; } }
Create a new browser instance.

@param  \Closure  $callback
@return \Laravel\Dusk\Browser|void
@throws \Exception
@throws \Throwable
Create a new browser instance .