PHPackages                             leowebguy/device-detect - 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. leowebguy/device-detect

ActiveCraft-plugin[Utility &amp; Helpers](/categories/utility)

leowebguy/device-detect
=======================

Craft plugin for detecting devices, OS, bots and more

3.1(1y ago)16.8k[1 issues](https://github.com/leowebguy/devicedetect/issues)proprietaryPHPPHP ^8.2

Since May 30Pushed 1y ago1 watchersCompare

[ Source](https://github.com/leowebguy/devicedetect)[ Packagist](https://packagist.org/packages/leowebguy/device-detect)[ RSS](/packages/leowebguy-device-detect/feed)WikiDiscussions main Synced today

READMEChangelog (7)Dependencies (6)Versions (8)Used By (0)

Device Detect plugin for Craft
==============================

[](#device-detect-plugin-for-craft)

### Detect devices, OS, bots and more

[](#detect-devices-os-bots-and-more)

Wrapper around [MobileDetect](http://mobiledetect.net/) by [@serbanghita](https://github.com/serbanghita)

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

[](#installation)

Open your terminal and go to your Craft project:

```
composer require leowebguy/device-detect -w && php craft plugin/install device-detect
```

Usage
-----

[](#usage)

The plugin exposes most of MobileDetect's methods, and can be used in your Twig:

```
{{ craft.deviceDetect.isMobile ? 'I am mobile.' : 'I am not mobile.' }}
```

Devices

```
{{ craft.deviceDetect.isMobile }}
{{ craft.deviceDetect.isTablet }}
{{ craft.deviceDetect.isiPad }}
{{ craft.deviceDetect.isPhone }}
```

OS

```
{{ craft.deviceDetect.isiOS }}
{{ craft.deviceDetect.isiPadOS }}
{{ craft.deviceDetect.isAndroidOS }}

User agent

```twig
{{ craft.deviceDetect.getUserAgent }}
```

getUserAgent returns string i.e. *Mozilla/5.0 (Macintosh; Intel Mac OS X 10\_15\_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36*

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity24

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 ~151 days

Recently: every ~180 days

Total

7

Last Release

588d ago

Major Versions

1.0.1 → 2.0.02022-12-01

2.0.1 → 3.0.02024-03-27

2.1 → 3.12024-11-22

PHP version history (3 changes)2.0.0PHP ^8.0

2.0.1PHP ^8.0.2

3.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/44216bb5de0cacbd3d995a1a71c3ee395bd36380305e547ac31452f86d4cd713?d=identicon)[leowebguy](/maintainers/leowebguy)

---

Top Contributors

[![leowebguy](https://avatars.githubusercontent.com/u/8460020?v=4)](https://github.com/leowebguy "leowebguy (6 commits)")

---

Tags

craft-plugincraftcmsmobileandroidbrowsersiphonedetectDevicestablets

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/leowebguy-device-detect/health.svg)

```
[![Health](https://phpackages.com/badges/leowebguy-device-detect/health.svg)](https://phpackages.com/packages/leowebguy-device-detect)
```

###  Alternatives

[hisorange/browser-detect

Browser &amp; Mobile detection package for Laravel.

1.1k10.9M61](/packages/hisorange-browser-detect)[spicyweb/craft-neo

A Matrix-like field type with block hierarchy

393813.5k10](/packages/spicyweb-craft-neo)[alexandernst/yii2-device-detect

Yii2 extension for Mobile-Detect library

140876.5k3](/packages/alexandernst-yii2-device-detect)[verbb/formie

The most user-friendly forms plugin for Craft.

102393.6k69](/packages/verbb-formie)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

54681.3k18](/packages/solspace-craft-freeform)[verbb/vizy

A flexible visual editor field for Craft.

4250.4k](/packages/verbb-vizy)

PHPackages © 2026

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