PHPackages                             digifa/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. digifa/mobile-detect-bundle

AbandonedArchivedSymfony-bundle[Utility &amp; Helpers](/categories/utility)

digifa/mobile-detect-bundle
===========================

Symfony 6.4, 7.0 / PHP 8.2 bundle to detect mobile devices, manage mobile view and redirect to the mobile and tablet version.

v2.3.2.4(1y ago)0195MITPHPPHP &gt;=8.2

Since Oct 16Pushed 1y agoCompare

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

READMEChangelog (5)Dependencies (16)Versions (7)Used By (0)

[![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 6.4.x / PHP 8.2 bundle to detect mobile devices, manage mobile view and redirect to the mobile and tablet version.

[![Github Actions Status](https://github.com/digifa/MobileDetectBundle/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/digifa/MobileDetectBundle/actions/workflows/main.yml?query=branch%3Amain) [![codecov](https://camo.githubusercontent.com/2e21e48c924e19756d33079ad363e36d0c0156c04f06a7a86d2b04f310cc8ee6/68747470733a2f2f636f6465636f762e696f2f6769746875622f6469676966612f4d6f62696c6544657465637442756e646c652f67726170682f62616467652e7376673f746f6b656e3d424e545a583930545853)](https://codecov.io/github/digifa/MobileDetectBundle)[![Latest Stable Version](https://camo.githubusercontent.com/9b9f5cc27a38134f4fb3601bdb031b74fd0d57e8aa2173eb48e1c1e0a2bca737/68747470733a2f2f706f7365722e707567782e6f72672f6469676966612f6d6f62696c652d6465746563742d62756e646c652f76)](https://packagist.org/packages/digifa/mobile-detect-bundle) [![Total Downloads](https://camo.githubusercontent.com/9b14f3e9118209425d57b5829a6ed5f021e8c82329c3598d1d44fea8ec017dcc/68747470733a2f2f706f7365722e707567782e6f72672f6469676966612f6d6f62696c652d6465746563742d62756e646c652f646f776e6c6f616473)](https://packagist.org/packages/digifa/mobile-detect-bundle) [![Latest Unstable Version](https://camo.githubusercontent.com/deb93011c8bccf0da41126ba14ba00b5ac7544dab7f751d1367fe4e720b11756/68747470733a2f2f706f7365722e707567782e6f72672f6469676966612f6d6f62696c652d6465746563742d62756e646c652f762f756e737461626c65)](https://packagist.org/packages/digifa/mobile-detect-bundle) [![License](https://camo.githubusercontent.com/44dcea716b7b18930fb83a3f68c777478df2f01b617215ccdc1561e629325afc/68747470733a2f2f706f7365722e707567782e6f72672f6469676966612f6d6f62696c652d6465746563742d62756e646c652f6c6963656e7365)](https://packagist.org/packages/digifa/mobile-detect-bundle) [![PHP Version Require](https://camo.githubusercontent.com/805da96e402931ef12040765656e412b7c961dbdb8732e90060f089d6951e572/68747470733a2f2f706f7365722e707567782e6f72672f6469676966612f6d6f62696c652d6465746563742d62756e646c652f726571756972652f706870)](https://packagist.org/packages/digifa/mobile-detect-bundle)

*This bundle is a fork of [tattali/MobileDetectBundle](https://github.com/tattali/MobileDetectBundle) that 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 [Mobile\_Detect](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`, `full`)
- Redirects to mobile and tablet sites

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 MobileDetectBundle\DeviceDetector\MobileDetectorInterface;

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

With Twig

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

#### Switch device view

[](#switch-device-view)

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

```
http://localhost:8000?device_view={full/mobile/tablet}
```

Or using the Symfony toolbar [![mbd-bundle-sf-toolbar](https://user-images.githubusercontent.com/10502887/161488224-aaedde1c-d3c3-4636-8761-a207fbd5d4ff.png)](https://user-images.githubusercontent.com/10502887/161488224-aaedde1c-d3c3-4636-8761-a207fbd5d4ff.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](src/Resources/meta/LICENSE) in the bundle

Original authors: [tattali](https://gihub.com/tattali), [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

32

—

LowBetter than 72% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

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

Total

6

Last Release

560d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/975d4de49a2daa54490e8aed9dbe1973be986c477e7ee241ae73112f071b8758?d=identicon)[digifa](/maintainers/digifa)

---

Top Contributors

[![tattali](https://avatars.githubusercontent.com/u/10502887?v=4)](https://github.com/tattali "tattali (84 commits)")[![suncat2000](https://avatars.githubusercontent.com/u/1162437?v=4)](https://github.com/suncat2000 "suncat2000 (83 commits)")[![netmikey](https://avatars.githubusercontent.com/u/1180845?v=4)](https://github.com/netmikey "netmikey (11 commits)")[![HenriVesala](https://avatars.githubusercontent.com/u/965788?v=4)](https://github.com/HenriVesala "HenriVesala (11 commits)")[![felp302](https://avatars.githubusercontent.com/u/2633381?v=4)](https://github.com/felp302 "felp302 (8 commits)")[![digifa](https://avatars.githubusercontent.com/u/16600298?v=4)](https://github.com/digifa "digifa (7 commits)")[![erivello](https://avatars.githubusercontent.com/u/626131?v=4)](https://github.com/erivello "erivello (6 commits)")[![ricoli](https://avatars.githubusercontent.com/u/1648125?v=4)](https://github.com/ricoli "ricoli (6 commits)")[![bocharsky-bw](https://avatars.githubusercontent.com/u/3317635?v=4)](https://github.com/bocharsky-bw "bocharsky-bw (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)")[![eugene-yurkevich](https://avatars.githubusercontent.com/u/198213176?v=4)](https://github.com/eugene-yurkevich "eugene-yurkevich (3 commits)")[![JonasHaouzi](https://avatars.githubusercontent.com/u/8245107?v=4)](https://github.com/JonasHaouzi "JonasHaouzi (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)")[![kerihenare](https://avatars.githubusercontent.com/u/181816?v=4)](https://github.com/kerihenare "kerihenare (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)")[![NicolasBadey](https://avatars.githubusercontent.com/u/639268?v=4)](https://github.com/NicolasBadey "NicolasBadey (2 commits)")

---

Tags

composermobile-detectionphpsymfony-bundlesymfony6-4symfony64symfony7symfonymobile detectmobile view managingdevice detectmobiledetectdevice detectormobiledetectbundlesymfony mobile detectsymfony mobiledetect

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[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.

371.0M1](/packages/tattali-mobile-detect-bundle)[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)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[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)

PHPackages © 2026

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