PHPackages                             jonathansudhakar/botdetector - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jonathansudhakar/botdetector

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jonathansudhakar/botdetector
============================

Bot detector for Laravel 4

2144PHP

Since Aug 21Pushed 11y ago1 watchersCompare

[ Source](https://github.com/jonathangizmo/botdetector)[ Packagist](https://packagist.org/packages/jonathansudhakar/botdetector)[ RSS](/packages/jonathansudhakar-botdetector/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Robot detector for Laravel 4
----------------------------

[](#robot-detector-for-laravel-4)

---

Installation
------------

[](#installation)

Add to composer.json:

```
require: "jonathansudhakar/botdetector": "dev-master"

```

Add to 'providers' in app/config/app.php

```
'Jonathansudhakar\Botdetector\BotdetectorServiceProvider'

```

Basic Usage
-----------

[](#basic-usage)

---

Detect if the the current request is a bot

```
Botdetector::isBot(); // returns true or false
Botdetector::detect()->isBot(); // returns true or false

```

Detect if the the current request is human

```
Botdetector::isHuman(); // returns true or false
Botdetector::detect()->isHuman(); // returns true or false

```

Detect if the a user-agent string is a bot (or Human)

```
Botdetector::isBot("user-agent-string"); // returns true or false
Botdetector::detect("user-agent-string")->isBot(); // returns true or false

```

More Options
------------

[](#more-options)

---

Get user-agent string

```
Botdetector::detect()->getAgent(); //returns user-agent string
Botdetector::detect("user-agent-string")->getAgent(); //returns user-agent string

```

Get list of user-agent strings being tested against apart from '/bot|crawl|slurp|spider/i' and '/Chrome/|Firefox/|Safari//i'.

```
Botdetector::detect()->getHumans(); //returns array with defaults
Botdetector::detect()->getBots(); //returns array with defaults
Botdetector::detect()->getHumans(false); //returns array without defaults
Botdetector::detect()->getBots(false); //returns array without defaults

```

Add list of user-agent strings to test against apart from '/bot|crawl|slurp|spider/i' and '/Chrome/|Firefox/|Safari//i'.

```
Botdetector::detect()->addHumans(array('list','of','human','user-agent strings'))->isBot(); //adds an array of humans to list of defaults
Botdetector::detect()->addBots(array('list','of','bot','user-agent strings'))->isBot(); //adds an array of bots to list of defaults

```

Option to not test against defaults including '/bot|crawl|slurp|spider/i' and '/Chrome/|Firefox/|Safari//i'.

```
Botdetector::detect()->ignoreDefaults()->isBot(); // Defaults to true if not set
Botdetector::detect()->ignoreDefaults(false)->isBot(); // Default setting

```

Option to test against a list of humans or bots in making a decision. Defaults to human.

```
Botdetector::detect()->useHumanData()->isBot(); // Defaults setting; Defaults to true
Botdetector::detect()->useHumanData(false)->isBot(); //Compares user-agent string against list of bots

```

Option to set empty string or null as bot or human. Defaults to bot.

```
Botdetector::detect()->isNullBot()->isBot(); // Defaults setting; Defaults to true
Botdetector::detect()->isNullBot(false)->isBot(); //Empty string/null reported as human

```

Functions can also be cascaded. Example:

```
Botdetector::detect("user-agent-string")->addHumans(array('list','of','human','user-agent strings'))->ignoreDefaults()->useHumanData()->isNullBot()->isBot();
Botdetector::detect()->addBots(array('list','of','bot','user-agent strings'))->ignoreDefaults(false)->useHumanData(false)->isNullBot(false)->getBots();

```

Intial Release Version v0.9
---------------------------

[](#intial-release-version-v09)

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/ea1b8c9715d66f3936832799f36a8d3c49a3c5002b5b852fb5f6991ea5b5fb53?d=identicon)[jonathangizmo](/maintainers/jonathangizmo)

---

Top Contributors

[![jonathansudhakar1](https://avatars.githubusercontent.com/u/1854861?v=4)](https://github.com/jonathansudhakar1 "jonathansudhakar1 (12 commits)")

### Embed Badge

![Health badge](/badges/jonathansudhakar-botdetector/health.svg)

```
[![Health](https://phpackages.com/badges/jonathansudhakar-botdetector/health.svg)](https://phpackages.com/packages/jonathansudhakar-botdetector)
```

###  Alternatives

[typisttech/wp-admin-tabs

Create tabbed navigation for WordPress admin dashboard, the OOP way

1712.5k](/packages/typisttech-wp-admin-tabs)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
