PHPackages                             tattali/mobile-detect-bundle - 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. tattali/mobile-detect-bundle

ActiveSymfony-bundle

tattali/mobile-detect-bundle
============================

Symfony 5.x-7.x bundle to detect mobile devices, manage mobile view and redirect to the mobile and tablet version.

v7.0.0(1y ago)371.0M↓17.1%12[3 issues](https://github.com/tattali/MobileDetectBundle/issues)1MITPHPPHP &gt;=8.2

Since Jan 9Pushed 1y ago1 watchersCompare

[ Source](https://github.com/tattali/MobileDetectBundle)[ Packagist](https://packagist.org/packages/tattali/mobile-detect-bundle)[ Docs](https://github.com/tattali/MobileDetectBundle)[ RSS](/packages/tattali-mobile-detect-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (17)Versions (34)Used By (1)

[![Mobile Detect](https://user-images.githubusercontent.com/10502887/161483098-d40a2d7d-0e78-4f38-a7ac-49390718746e.png)](https://user-images.githubusercontent.com/10502887/161483098-d40a2d7d-0e78-4f38-a7ac-49390718746e.png)

MobileDetectBundle
==================

[](#mobiledetectbundle)

Symfony 5.4.x-7.0 bundle to detect mobile devices, manage mobile view and redirect to the mobile and tablet version.

[![Github Actions Status](https://github.com/tattali/MobileDetectBundle/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/tattali/MobileDetectBundle/actions/workflows/main.yml?query=branch%3Amain)[![Latest Stable Version](https://camo.githubusercontent.com/6ba4909460f664592e558bafe5b044bd964b53cd4f319d25086d92e60811d80f/68747470733a2f2f706f7365722e707567782e6f72672f74617474616c692f6d6f62696c652d6465746563742d62756e646c652f76)](https://packagist.org/packages/tattali/mobile-detect-bundle)[![Packagist Downloads](https://camo.githubusercontent.com/ef8c7c2d54ff104d5acf8cbdf31b58543f9ff7f78b8b1f726a29f75c2dfd0051/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f74617474616c692f6d6f62696c652d6465746563742d62756e646c65)](https://packagist.org/packages/tattali/mobile-detect-bundle)[![Coverage](https://camo.githubusercontent.com/6adfecd7273fa4d3058f1441f9a2eac9da3ea0251ebd5efd626b14ba43efb079/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d74617474616c695f4d6f62696c6544657465637442756e646c65266d65747269633d636f766572616765)](https://sonarcloud.io/summary/new_code?id=tattali_MobileDetectBundle)[![Packagist License](https://camo.githubusercontent.com/e880cf3a0d96fc39720aa1e14ed270edcd197cf7f0d86fc86e644954934b79aa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f74617474616c692f6d6f62696c652d6465746563742d62756e646c65)](https://packagist.org/packages/tattali/mobile-detect-bundle)[![Packagist Dependency Version](https://camo.githubusercontent.com/821e8920a582e156f898359a1347fa6d208d6dc4981f24c948cd8f3f31d88fb7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f74617474616c692f6d6f62696c652d6465746563742d62756e646c652f706870)](https://packagist.org/packages/tattali/mobile-detect-bundle)

*This bundle is a fork of [suncat2000/MobileDetectBundle](https://github.com/suncat2000/MobileDetectBundle). As this project doesn't look maintained anymore, we decided to create &amp; maintain a fork. For more information read our [manifest](https://github.com/tattali/MobileDetectBundle/issues/8).*

Introduction
------------

[](#introduction)

This Bundle use [MobileDetect](https://github.com/serbanghita/Mobile-Detect) class and provides the following features:

- Detect the various mobile devices by Name, OS, browser User-Agent
- Manages site views for the various mobile devices (`mobile`, `tablet`, `desktop`)
- Redirects to mobile and tablet sites
- **[Migrate to 7x](src/Resources/doc/migration-7x.md)**

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

[](#documentation)

### Installation

[](#installation)

```
composer require tattali/mobile-detect-bundle
```

*Install with Symfony legacy versions: [here](src/Resources/doc/legacy-versions.md)*

### Usage

[](#usage)

#### Checking device

[](#checking-device)

```
use Detection\MobileDetect;

public function someaction(MobileDetect $mobileDetector)
{
    $mobileDetector->isMobile();
    $mobileDetector->isTablet();
    $mobileDetector->is('iPhone');
}
```

With Twig

```
{% if is_mobile() %}
{% if is_tablet() %}
{% if is_device('iPhone') %} # magic methods is[...]
```

Available User-Agents (uaMatch) with the php `is()` and twig `is_device()` [here](https://github.com/serbanghita/Mobile-Detect/blob/4.8.x/MobileDetect.json)

#### Switch device view

[](#switch-device-view)

For switch device view, use `device_view` GET parameter:

```
https://localhost:8000?device_view={desktop/mobile/tablet}
```

Or using the Symfony toolbar [![mbd-bundle-sf-toolbar](src/Resources/doc/sf-toolbar.png)](src/Resources/doc/sf-toolbar.png)

#### Going further

[](#going-further)

- [Symfony legacy versions](src/Resources/doc/legacy-versions.md)
- [Redirection](src/Resources/doc/redirection.md)
- [Full reference](src/Resources/doc/reference.md)

Contribute and feedback
-----------------------

[](#contribute-and-feedback)

Any feedback and contribution will be very appreciated.

License and credits
-------------------

[](#license-and-credits)

This bundle is under the MIT license. See the complete [license](LICENSE) in the bundle

Original authors: [suncat2000](https://github.com/suncat2000), [HenriVesala](https://github.com/HenriVesala), [netmikey](https://github.com/netmikey) and [all contributors](https://github.com/suncat2000/MobileDetectBundle/graphs/contributors)

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity51

Moderate usage in the ecosystem

Community27

Small or concentrated contributor base

Maturity87

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~220 days

Total

32

Last Release

511d ago

Major Versions

v0.10.3 → v1.0.02016-03-14

v1.1.1 → v2.1.02020-03-25

v2.3.1 → v7.0.02024-12-23

PHP version history (6 changes)v0.9.0PHP &gt;=5.3.0

v1.0.0PHP &gt;=5.5.0

v1.0.6PHP &gt;=5.5.9

v2.1.0PHP &gt;=7.1

v2.2.1PHP &gt;=7.2.5

v2.3.1PHP &gt;=8.2

### Community

Maintainers

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

---

Top Contributors

[![tattali](https://avatars.githubusercontent.com/u/10502887?v=4)](https://github.com/tattali "tattali (86 commits)")[![suncat2000](https://avatars.githubusercontent.com/u/1162437?v=4)](https://github.com/suncat2000 "suncat2000 (83 commits)")[![HenriVesala](https://avatars.githubusercontent.com/u/965788?v=4)](https://github.com/HenriVesala "HenriVesala (11 commits)")[![netmikey](https://avatars.githubusercontent.com/u/1180845?v=4)](https://github.com/netmikey "netmikey (11 commits)")[![felp302](https://avatars.githubusercontent.com/u/2633381?v=4)](https://github.com/felp302 "felp302 (8 commits)")[![erivello](https://avatars.githubusercontent.com/u/626131?v=4)](https://github.com/erivello "erivello (6 commits)")[![bocharsky-bw](https://avatars.githubusercontent.com/u/3317635?v=4)](https://github.com/bocharsky-bw "bocharsky-bw (6 commits)")[![ricoli](https://avatars.githubusercontent.com/u/1648125?v=4)](https://github.com/ricoli "ricoli (6 commits)")[![Ninir](https://avatars.githubusercontent.com/u/855022?v=4)](https://github.com/Ninir "Ninir (5 commits)")[![xabbuh](https://avatars.githubusercontent.com/u/1957048?v=4)](https://github.com/xabbuh "xabbuh (4 commits)")[![alexhoma](https://avatars.githubusercontent.com/u/7917771?v=4)](https://github.com/alexhoma "alexhoma (3 commits)")[![JonasHaouzi](https://avatars.githubusercontent.com/u/8245107?v=4)](https://github.com/JonasHaouzi "JonasHaouzi (3 commits)")[![eugene-yurkevich](https://avatars.githubusercontent.com/u/198213176?v=4)](https://github.com/eugene-yurkevich "eugene-yurkevich (3 commits)")[![trq](https://avatars.githubusercontent.com/u/32683?v=4)](https://github.com/trq "trq (3 commits)")[![sfdumi](https://avatars.githubusercontent.com/u/3295012?v=4)](https://github.com/sfdumi "sfdumi (2 commits)")[![NicolasBadey](https://avatars.githubusercontent.com/u/639268?v=4)](https://github.com/NicolasBadey "NicolasBadey (2 commits)")[![juulrecognize](https://avatars.githubusercontent.com/u/61468406?v=4)](https://github.com/juulrecognize "juulrecognize (2 commits)")[![iamdey](https://avatars.githubusercontent.com/u/65737?v=4)](https://github.com/iamdey "iamdey (2 commits)")[![kerihenare](https://avatars.githubusercontent.com/u/181816?v=4)](https://github.com/kerihenare "kerihenare (2 commits)")[![emarref](https://avatars.githubusercontent.com/u/556594?v=4)](https://github.com/emarref "emarref (2 commits)")

---

Tags

composermobile-detectphpsymfonysymfony-bundlesymfonymobile detectmobile view managingdevice detectmobiledetectdevice detectormobiledetectbundlesymfony mobile detectsymfony mobiledetect

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tattali-mobile-detect-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/tattali-mobile-detect-bundle/health.svg)](https://phpackages.com/packages/tattali-mobile-detect-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[simplesamlphp/simplesamlphp

A PHP implementation of a SAML 2.0 service provider and identity provider.

1.1k12.4M193](/packages/simplesamlphp-simplesamlphp)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)

PHPackages © 2026

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