Skip to content

JayBizzle/Laravel-Crawler-Detect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Crawler Detect

Build Status Total Downloads Scrutinizer Code Quality Laravel StyleCI

A Laravel 5 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

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

  'Jaybizzle\LaravelCrawlerDetect\LaravelCrawlerDetectServiceProvider',

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

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

Usage

// 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
}