A Laravel package to detect web crawlers via the user agent
zanysoft/laravel-crawler-detect is a Laravel package for a laravel package to detect web crawlers via the user agent.
It currently has 2 GitHub stars and 369 downloads on Packagist (latest version 1.0).
Install it with composer require zanysoft/laravel-crawler-detect.
Discover more Laravel packages by zanysoft
or browse all Laravel packages to compare alternatives.
Last updated
Run composer require zanysoft/laravel-crawler-detect or add "zanysoft/laravel-crawler-detect": "^1.0" to your composer.json file.
Add the following to the providers array in your config/app.php file..
ZanySoft\LaravelCrawlerDetect\LaravelCrawlerDetectServiceProvider::class,
...and the following to your aliases array...
'Crawler' => 'ZanySoft\LaravelCrawlerDetect\Facades\LaravelCrawler',
Laravel 5.5 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.
// Check current 'visitors' user agent
if(Crawler::isCrawler()) {
// true if crawler user agent detected
}
// Pass a user agent as a string
if(Crawler::isCrawler('Mozilla/5.0 (compatible; aiHitBot/2.9; +https://www.aihitdata.com/about)')) {
// true if crawler user agent detected
}