Laravel - Browser Tests - Attaching Files

The attach method may be used to attach a file to a file input element. Like many other input related methods, a full CSS selector is not required. If a CSS selector match can't be found, Dusk will search for a file input with a matching name attribute:

    $browser->attach('photo', __DIR__.'/photos/mountains.png');
The attach function requires the Zip PHP extension to be installed and enabled on your server.