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.5k[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 1mo ago

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 72% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

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

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

[jenssegers/agent

Desktop/mobile user agent parser with support for Laravel, based on Mobiledetect

4.8k67.8M440](/packages/jenssegers-agent)[hisorange/browser-detect

Browser &amp; Mobile detection package for Laravel.

1.1k10.1M50](/packages/hisorange-browser-detect)[suncat/mobile-detect-bundle

Symfony2/3/4 bundle for detect mobile devices, managing mobile view types, redirect to mobile version.

4035.3M7](/packages/suncat-mobile-detect-bundle)[dmamontov/favicon

Class generation favicon for browsers and devices Android, Apple, Windows and display of html code. It supports a large number of settings such as margins, color, compression, three different methods of crop and screen orientation.

523.7k](/packages/dmamontov-favicon)[leonardoteixeira/pushover

A simple PHP library for the Pushover service

1827.7k3](/packages/leonardoteixeira-pushover)

PHPackages © 2026

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