Laravel Cloud is here! Zero-config managed infrastructure for Laravel apps. Deploy now.

Laravel Crawler Detect

jaybizzle/laravel-crawler-detect image

Laravel Crawler Detect stats

Downloads
1.3M
Stars
294
Open Issues
2
Forks
29

View on GitHub →

A Laravel package to detect web crawlers via the user agent

Laravel Crawler Detect

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
}
JayBizzle photo

Father of two, Airplane Geek, Beer Lover, Yorkshire to the core, Rugby League fan, Tech Nerd!

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


Jaybizzle Laravel Crawler Detect Related Articles

Serve Markdown Versions of Your Laravel Pages to AI Agents image

Serve Markdown Versions of Your Laravel Pages to AI Agents

Read article
Blastup logo

Blastup

Blastup provides social media enhancement services including buying Instagram likes, followers, and views, with features like instant delivery and a variety of packages to suit different needs.

Blastup
Tighten logo

Tighten

We help companies turn great ideas into amazing apps, products, and services.

Tighten
Securing Laravel logo

Securing Laravel

The essential security resource for Laravel devs, covering everything you need to keep your apps secure. Sign up to receive weekly security tips and monthly in depth articles, diving deep into security concepts you need to know!

Securing Laravel
Get expert guidance in a few days with a Laravel code review logo

Get expert guidance in a few days with a Laravel code review

Expert code review! Get clear, practical feedback from two Laravel devs with 10+ years of experience helping teams build better apps.

Get expert guidance in a few days with a Laravel code review
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm
Curotec logo

Curotec

World class Laravel experts with GenAI dev skills. LATAM-based, embedded engineers that ship fast, communicate clearly, and elevate your product. No bloat, no BS.

Curotec