Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jaybizzle/laravel-crawler-detect
A Laravel wrapper for CrawlerDetect - the web crawler detection library
https://github.com/jaybizzle/laravel-crawler-detect
bot crawler detect laravel php spider
Last synced: 5 days ago
JSON representation
A Laravel wrapper for CrawlerDetect - the web crawler detection library
- Host: GitHub
- URL: https://github.com/jaybizzle/laravel-crawler-detect
- Owner: JayBizzle
- License: mit
- Created: 2015-03-18T20:59:36.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2022-07-06T10:43:38.000Z (over 2 years ago)
- Last Synced: 2024-10-29T18:07:20.359Z (2 months ago)
- Topics: bot, crawler, detect, laravel, php, spider
- Language: PHP
- Homepage:
- Size: 230 KB
- Stars: 310
- Watchers: 13
- Forks: 30
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Laravel Crawler Detect
=======
[![Build Status](https://img.shields.io/travis/JayBizzle/Laravel-Crawler-Detect/master.svg?style=flat-square)](https://travis-ci.org/JayBizzle/Laravel-Crawler-Detect) [![Total Downloads](https://img.shields.io/packagist/dt/JayBizzle/Laravel-Crawler-Detect.svg?style=flat-square)](https://packagist.org/packages/jaybizzle/laravel-crawler-detect)
[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/JayBizzle/Laravel-Crawler-Detect.svg?style=flat-square)](https://scrutinizer-ci.com/g/JayBizzle/Laravel-Crawler-Detect/?branch=master) [![StyleCI](https://styleci.io/repos/32484055/shield)](https://styleci.io/repos/32484055)A Laravel wrapper for [CrawlerDetect](https://github.com/JayBizzle/Crawler-Detect) - 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](https://github.com/JayBizzle/Laravel-Crawler-Detect/tree/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..
```PHP
Jaybizzle\LaravelCrawlerDetect\LaravelCrawlerDetectServiceProvider::class,
```...and the following to your `aliases` array...
```PHP
'Crawler' => Jaybizzle\LaravelCrawlerDetect\Facades\LaravelCrawlerDetect::class,
```Laravel 5.5 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.
Usage
==================
```PHP
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
}