Skip to content
A Laravel wrapper for CrawlerDetect - the web crawler detection library
PHP
Branch: master
Clone or download
Latest commit 9b81bfd Dec 6, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Fix service provider Jan 25, 2017
tests fix style ci error Apr 6, 2018
.coveralls.yml Initial commit Mar 18, 2015
.gitignore Initial commit Mar 18, 2015
.styleci.yml Tweak settings Jan 25, 2017
.travis.yml Test on PHP 7.3 Dec 6, 2018
LICENSE Update copyright Jan 25, 2017
README.md Update README.md Apr 6, 2018
composer.json alias PHPUnit namespace Apr 6, 2018
phpunit.xml alias PHPUnit namespace Apr 6, 2018

README.md

Laravel Crawler Detect

Build Status Total Downloads Scrutinizer Code Quality StyleCI

A Laravel wrapper for CrawlerDetect - the web crawler detection library

Installation

Run composer require jaybizzle/laravel-crawler-detect 1.* or add "jaybizzle/laravel-crawler-detect": "1.*" to your composer.json file.

The last version compatible with Laravel 4 was v1.0.2 so if you need that, you will have to fix your composer.json to that specific version.

Add the following to the providers array in your config/app.php file..

  Jaybizzle\LaravelCrawlerDetect\LaravelCrawlerDetectServiceProvider::class,

...and the following to your aliases array...

  'Crawler'   => Jaybizzle\LaravelCrawlerDetect\Facades\LaravelCrawlerDetect::class,

Laravel 5.5 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.

Usage

use Crawler;

// 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
}
You can’t perform that action at this time.