Try Depot: Bring ultra-fast, remote Docker builds directly to your Laravel workflow

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

Tailwind has Open-sourced the V4 Alpha image

Tailwind has Open-sourced the V4 Alpha

Read article
Laravel Cloud logo

Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Cloud
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
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
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Acquaint Softtech logo

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift