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 2w ago

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 66% 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

2746d 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

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k51.0M7.8k](/packages/larastan-larastan)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77018.2M127](/packages/laravel-mcp)[spatie/laravel-export

Create a static site bundle from a Laravel app

672139.5k6](/packages/spatie-laravel-export)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

815320.5k3](/packages/defstudio-telegraph)[api-platform/laravel

API Platform support for Laravel

59156.3k11](/packages/api-platform-laravel)

PHPackages © 2026

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