PHPackages                             dungeonworx/laravel-devicedetector - 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. dungeonworx/laravel-devicedetector

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

dungeonworx/laravel-devicedetector
==================================

Integration with DeviceDetector and Laravel.

1.0.4(7y ago)91792MITPHP

Since Dec 23Pushed 7y agoCompare

[ Source](https://github.com/dungeonworx/devicedetector)[ Packagist](https://packagist.org/packages/dungeonworx/laravel-devicedetector)[ Docs](https://dungeonworx.org/devicedetector/)[ RSS](/packages/dungeonworx-laravel-devicedetector/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (6)Versions (5)Used By (0)

Laravel DeviceDetector Bridge
=============================

[](#laravel-devicedetector-bridge)

[![Latest Stable Version](https://camo.githubusercontent.com/6fa09d5c5aabb1abd501e670bec5b6aeaa551a3d1e0a3c2d8213d6cf63fd3667/68747470733a2f2f706f7365722e707567782e6f72672f64756e67656f6e776f72782f6c61726176656c2d6465766963656465746563746f722f762f737461626c653f666f726d61743d666c6174)](https://packagist.org/packages/dungeonworx/laravel-devicedetector)[![Latest Unstable Version](https://camo.githubusercontent.com/7c523b491cf095ae223e754fd0c371b046be22fd57bc44d3627aa77ae5b90543/68747470733a2f2f706f7365722e707567782e6f72672f64756e67656f6e776f72782f6c61726176656c2d6465766963656465746563746f722f762f756e737461626c653f666f726d61743d666c6174)](https://packagist.org/packages/dungeonworx/laravel-devicedetector)[![Total Downloads](https://camo.githubusercontent.com/c62f1870e34c94aa614562360f361982a1e3fcb5dc8921500e1fcd04daa5dadf/68747470733a2f2f706f7365722e707567782e6f72672f64756e67656f6e776f72782f6c61726176656c2d6465766963656465746563746f722f646f776e6c6f6164733f666f726d61743d666c6174)](https://packagist.org/packages/dungeonworx/laravel-devicedetector)[![License](https://camo.githubusercontent.com/9b1a71ca485f99bd0f8cb032470c1951fadfd9d61f2216d62602674632ad5ae1/68747470733a2f2f706f7365722e707567782e6f72672f64756e67656f6e776f72782f6c61726176656c2d6465766963656465746563746f722f6c6963656e73653f666f726d61743d666c6174)](https://packagist.org/packages/dungeonworx/laravel-devicedetector)[![Build Status](https://camo.githubusercontent.com/d917599b38c942fa465ee9a8b202ce8b70e1882a0de5c5e45a21cfc48ca9a290/68747470733a2f2f7472617669732d63692e6f72672f64756e67656f6e776f72782f6465766963656465746563746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/dungeonworx/devicedetector)

This package was created out of a need to integrate [Piwik's DeviceDetector](https://packagist.org/packages/piwik/device-detector)package into my Laravel application in a specific way. After working on the code in my project, I realized this package would be best suited to be a package and committed publicly for consumption.

The goal of this project is to provide easier access to the DeviceDetector library and also wrap it in an easy to use Laravel Facade to facilitate seamless access in other areas of the code. This library also provides a middleware which provides some additional information in your request payload to modify parts of your application based on the device that is currently connected.

Usage
-----

[](#usage)

### Facade

[](#facade)

If you include the middleware in your requests, you only need to use the Facade's methods, which are [documented](https://dungeonworx.org/devicedetector/classes/Dungeonworx.DeviceDetector.DeviceDetector.html).

If you do not use the middleware in your request, or you wish to check a different user agent, you will need to pass the optional `user_agent` parameter to the specific method. Please note, this changes the parsed results for all future requests as well. So if you wish to go back to returning value for the current browser request, you will need to call `DeviceDetector::get($request->userAgent())` once more to reset back to the current browsing session.

```
use Dungeonworx\DeviceDetector\DeviceDetector;

// Dump the DeviceDetector attributes to the client.
dd(DeviceDetector::getAttributes());
```

```
[
    "browser" => true,
    "camera" => false,
    "car" => false,
    "console" => false,
    "desktop" => true,
    "feature_phone" => false,
    "feed_reader" => false,
    "library" => false,
    "media_player" => false,
    "mobile_app" => false,
    "mobile_device" => false,
    "phone_tablet" => false,
    "pim" => false,
    "portable_media_player" => false,
    "smart_display" => false,
    "smart_phone" => false,
    "tablet" => false,
    "touch_enabled" => false,
    "tv" => false,
]
```

### Middleware

[](#middleware)

To use this package in your middleware, just add the `device_detector` middleware alias to your `web` middleware in the `Http/Kernel.php` file in your project. Once that's installed, you can access the four included detectors in your request. The `is` key in the request contains an array with four booleans; `bot`, `desktop`, `mobile`, and `touch`. These booleans are available for every request and also cached to your already assigned cache repository.

```
// Get the booleans from DeviceDetector.
$request->get('is');
```

```
[
    'bot'     => false,
    'desktop' => true,
    'mobile'  => false,
    'touch'   => false,
]
```

Documentation
-------------

[](#documentation)

This package is documented using [phpDocumentor](https://www.phpdoc.org/) and it's API documentation can be located [here](https://dungeonworx.org/devicedetector/).

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

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

2697d ago

### Community

Maintainers

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

---

Top Contributors

[![scrothers](https://avatars.githubusercontent.com/u/111015?v=4)](https://github.com/scrothers "scrothers (2 commits)")

---

Tags

laravellaravel-facadelaravel-middlewarelaravel-packageuser-agentuser-agent-parserlaravellaravel-packageuser agentlaravel middlewareUser agent parserlaravel-facade

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dungeonworx-laravel-devicedetector/health.svg)

```
[![Health](https://phpackages.com/badges/dungeonworx-laravel-devicedetector/health.svg)](https://phpackages.com/packages/dungeonworx-laravel-devicedetector)
```

###  Alternatives

[spatie/laravel-enum

Laravel Enum support

3655.4M31](/packages/spatie-laravel-enum)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[laragear/preload

Effortlessly make a Preload script for your Laravel application.

119363.5k](/packages/laragear-preload)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[dragon-code/pretty-routes

Pretty Routes for Laravel

10058.7k4](/packages/dragon-code-pretty-routes)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40129.3k2](/packages/erlandmuchasaj-laravel-gzip)

PHPackages © 2026

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