PHPackages                             handsetdetection/laravel51-provider - 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. handsetdetection/laravel51-provider

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

handsetdetection/laravel51-provider
===================================

A Laravel 5.1 service provider for the HandsetDetection v4.x PHP API kit

1.0.4(10y ago)14.6k[1 issues](https://github.com/handsetdetection/laravel51-provider/issues)MITPHP

Since Jun 6Pushed 10y ago1 watchersCompare

[ Source](https://github.com/handsetdetection/laravel51-provider)[ Packagist](https://packagist.org/packages/handsetdetection/laravel51-provider)[ RSS](/packages/handsetdetection-laravel51-provider/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

Laravel 5.1 LTS Wrapper for Handset Detection
=============================================

[](#laravel-51-lts-wrapper-for-handset-detection)

A minimal service provider to set up and use the Handset Detection 4.x PHP library in Laravel v5.1 LTS.

Usage example
-------------

[](#usage-example)

```
/**
 * Where $httpHeaders is a key=>value array of headers, for example :
 *     array(
 *         'user-agent' => "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_3 like Mac OS X; fr_FR) AppleWebKit (KHTML, like Gecko) Mobile"
 *     )
 **/
$hd = App('HandsetDetection');
$hd->deviceDetect($httpHeaders);

```

Call any of the Handset Detection 4.x PHP library methods in this same fashion. Additional examples at [PHP APIKit Home](https://github.com/HandsetDetection/php-apikit "Handset Detection PHP APIKit") .

```
$hd->deviceVendors();
$hd->deviceModels('Nokia');
$hd->deviceWhatHas('network', 'EDGE');
$hd->deviceFetchArchive();
$hd->communityFetchArchive();

```

Here's a snippet that ties it all together with a few sample detections.

```
$data = array (
	array (
		'user-agent' => "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36"
	),
	array (
		'user-agent' => "Mozilla/5.0 (Linux; U; Android 2.3.6; en-us; SAMSUNG-SGH-I577 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"
	),
	array (
		'user-agent' => "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_3 like Mac OS X; fr_FR) AppleWebKit (KHTML, like Gecko) Mobile [FBAN/FBForIPhone;FBAV/4.0.2;FBBV/4020.0;FBDV/iPhone3,1;FBMD/iPhone;FBSN/iPhone OS;FBSV/4.3.3;FBSS/2; FBCR/TELUS;FBID/phone;FBLC/fr_FR;FBSF/2.0]"
	),
	array (
		'user-agent' => "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_3 like Mac OS X; fr_FR) AppleWebKit (KHTML, like Gecko) Mobile",
		'x-local-hardwareinfo' => "480:320:275:200"
	)
);

$hd = App('HandsetDetection');
foreach ($data as $headers) {
	$return = $hd->deviceDetect($headers);
	$reply = $hd->getReply();
	$this->info(json_encode($reply));
}

```

Setup
-----

[](#setup)

### Step 1: Adding the dependency to composer.json

[](#step-1-adding-the-dependency-to-composerjson)

Add this to your composer.json. This will also fetch

```
"require": {
    "handsetdetection/laravel51-provider": "1.*",
}

```

### Step 2: Register the service provider

[](#step-2-register-the-service-provider)

Register the service provider in config/app.php by inserting into the providers array

```
'providers' => [
    HandsetDetection\Laravel51Provider\HandsetDetectionServiceProvider::class,
]

```

### Step 3: From the command-line run

[](#step-3-from-the-command-line-run)

```
php artisan vendor:publish --provider="HandsetDetection\Laravel51Provider\HandsetDetectionServiceProvider"

```

This will publish config/handsetdetection.php to your config folder.

### Step 4: Edit your config file

[](#step-4-edit-your-config-file)

Place your Handset Detection access credentials in the config file.

Job Done.

Let us know if you have any hassles :

Happy Detecting :-)

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity66

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

3675d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/92d21049bbe13c6cca11b3eb9b5e6e409c5c09d07a6a585c6f615f876686f19e?d=identicon)[elricho](/maintainers/elricho)

---

Top Contributors

[![elricho](https://avatars.githubusercontent.com/u/389028?v=4)](https://github.com/elricho "elricho (1 commits)")

### Embed Badge

![Health badge](/badges/handsetdetection-laravel51-provider/health.svg)

```
[![Health](https://phpackages.com/badges/handsetdetection-laravel51-provider/health.svg)](https://phpackages.com/packages/handsetdetection-laravel51-provider)
```

###  Alternatives

[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17818.7k](/packages/markwalet-nova-modal-response)[crumbls/layup

A visual page builder plugin for Filament 5 — Divi-style grid layouts with extensible widgets.

591.7k1](/packages/crumbls-layup)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.2k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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