zgetro/laravel-dusk-chromedriver

A Laravel Artisan command to download matching ChromeDriver binaries for Windows, Linux, Mac, with WSL host detection support.

v1.1.1 2025-05-21 15:42 UTC

This package is auto-updated.

Last update: 2025-05-22 06:20:10 UTC


README

πŸš— Laravel ChromeDriver Downloader

A Laravel Artisan command that auto-magically detects your Chrome version, downloads the right ChromeDriver for Windows πŸͺŸ, Linux 🐧, and Mac 🍏 β€” with exclusive WSL support!

🧠 Smart Β· πŸ€– Automated Β· ⚑ Fast Β· 🧩 Cross-Platform Β· πŸ’» WSL-Aware

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

🧩 Features

  • 🎯 Detects your Chrome version precisely
  • πŸ’» Supports downloading drivers for:
    • Windows (chromedriver-win64)
    • Linux (chromedriver-linux64)
    • macOS (chromedriver-mac-arm64 / mac-x64)
  • 🐧 WSL Smart Detection – detects Chrome version from Windows host
  • βš™οΈ Stores drivers in .vendor/laravel/dusk/bin/
  • πŸ”€ Supports --all flag to download drivers for all OSes
  • βœ… Laravel 6–11 compatible
  • πŸ§ͺ PHPUnit support for testing the command

πŸš€ Installation

composer require zgetro/laravel-dusk-chromedriver --dev

πŸ› οΈ Usage

php artisan dusk:download-chromedriver

By default, this will:

  • Detect the local Chrome version
  • Download the matching ChromeDriver for your OS
  • Save it as .vendor/laravel/dusk/bin/chromedriver-[os]

🧬 Download All Drivers

php artisan dusk:download-chromedriver --all

This downloads all supported platform drivers β€” ideal for testing or CI.

βš™οΈ Environment Compatibility

OS Chrome Detection Method
Linux google-chrome --version / chromium-browser
macOS mdls metadata or standard version queries
Windows PowerShell: read .exe version
WSL PowerShell bridge to detect host Windows Chrome βœ…

πŸ“¦ Output Directory

All drivers are stored under:

.vendor/laravel/dusk/bin/

With friendly names:

  • chromedriver-win
  • chromedriver-linux
  • chromedriver-mac

πŸ§ͺ Testing

composer test

Supports phpunit via Orchestra Testbench.

πŸ§™ Behind the Scenes

Your Artisan command is your wand. This package just makes it magical.

The package:

  • etches your Chrome version using OS-specific logic
  • Queries official Chrome for Testing URLs
  • Extracts & renames the ChromeDriver zip content
  • Makes it executable where needed

🧰 Requirements

  • PHP 7.4 or newer
  • Laravel 6.x to 11.x
  • Internet access (to download drivers)

🧾 License

MIT Β© zgetro

πŸ’‘ Contributing

PRs welcome! Feel free to submit issues, add test coverage, or request new features.

🐣 Fun Fact Did you know the ChromeDriver you use every day is based on the WebDriver protocol – a W3C standard? You’re not just testing… you’re browsing the web like a boss.
--Thanks CHATGPT--