jaybizzle / laravel-crawler-detect
A Laravel package to detect web crawlers via the user agent
Package info
github.com/JayBizzle/Laravel-Crawler-Detect
pkg:composer/jaybizzle/laravel-crawler-detect
v2.0.0
2026-07-11 08:22 UTC
Requires
- php: ^8.1
- illuminate/support: ^10.0|^11.0|^12.0|^13.0
- jaybizzle/crawler-detect: ^1.2
Requires (Dev)
- laravel/pint: ^1.13
- orchestra/testbench: ^8.0|^9.0|^10.0|^11.0
- phpunit/phpunit: ^10.5|^11.0|^12.0
This package is auto-updated.
Last update: 2026-07-11 08:34:09 UTC
README
A Laravel wrapper for Crawler-Detect - the web crawler detection library.
Requirements
- PHP 8.1+
- Laravel 10, 11, 12 or 13
Need support for an older version of Laravel or PHP? Use v1.3.0 of this package.
Installation
composer require jaybizzle/laravel-crawler-detect
The service provider and the Crawler facade alias are registered automatically via package auto-discovery.
Usage
use Crawler; // Check the current visitor's user agent if (Crawler::isCrawler()) { // true if a crawler user agent was detected } // Or pass a user agent string to check if (Crawler::isCrawler('Mozilla/5.0 (compatible; aiHitBot/2.9; +https://www.aihitdata.com/about)')) { // true if a crawler user agent was detected } // Output the name of the bot that matched (if any) echo Crawler::getMatches();
You can also type-hint the underlying class and let the container inject it:
use Jaybizzle\CrawlerDetect\CrawlerDetect; public function index(CrawlerDetect $crawlerDetect) { if ($crawlerDetect->isCrawler()) { // ... } }
Testing
composer test
License
Laravel Crawler Detect is open-sourced software licensed under the MIT license.