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

ActiveSymfony-bundle

kematjaya/mobile-detect-bundle
==============================

Symfony 7.4|8.0 bundle to detect mobile devices, manage mobile view and redirect to the mobile and tablet version.

8.0(1mo ago)01↑2900%MITPHPPHP &gt;=8.4

Since Mar 28Pushed 1mo agoCompare

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

READMEChangelogDependencies (9)Versions (2)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 7 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/74dc153c4e0dadd40dc5fb1c6f9e43992eb1ae91e425981fc3f86ab19b94358b/687474703a2f2f706f7365722e707567782e6f72672f74617474616c692f6d6f62696c652d6465746563742d62756e646c652f76)](https://packagist.org/packages/tattali/mobile-detect-bundle) [![Total Downloads](https://camo.githubusercontent.com/0f544a5ed23d7f910013e07214d3ec32ae18172808fb7455f8b95316b4057dc7/687474703a2f2f706f7365722e707567782e6f72672f74617474616c692f6d6f62696c652d6465746563742d62756e646c652f646f776e6c6f616473)](https://packagist.org/packages/tattali/mobile-detect-bundle) [![codecov](https://camo.githubusercontent.com/581c40170fbb314c06faf7763431882be3cc1ba4a18c272ee27754b6dd31aead/68747470733a2f2f636f6465636f762e696f2f67682f74617474616c692f4d6f62696c6544657465637442756e646c652f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d485756314f5952534439)](https://codecov.io/gh/tattali/MobileDetectBundle) [![License](https://camo.githubusercontent.com/ff84c231d785364b66cdb3f805432952d11fc7d53d4982851b3032f3d7243570/687474703a2f2f706f7365722e707567782e6f72672f74617474616c692f6d6f62696c652d6465746563742d62756e646c652f6c6963656e7365)](https://packagist.org/packages/tattali/mobile-detect-bundle) [![PHP Version Require](https://camo.githubusercontent.com/a84982851924e3b73409faae166255d3625493de9a466765b794b0fab8b425b0/687474703a2f2f706f7365722e707567782e6f72672f74617474616c692f6d6f62696c652d6465746563742d62756e646c652f726571756972652f706870)](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 [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 kematjaya/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: [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

41

—

FairBetter than 89% of packages

Maintenance90

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity51

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

Unknown

Total

1

Last Release

46d ago

### Community

Maintainers

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

---

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)")[![xpanel](https://avatars.githubusercontent.com/u/5144826?v=4)](https://github.com/xpanel "xpanel (13 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)")[![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)")[![erivello](https://avatars.githubusercontent.com/u/626131?v=4)](https://github.com/erivello "erivello (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)")[![trq](https://avatars.githubusercontent.com/u/32683?v=4)](https://github.com/trq "trq (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)")[![juulrecognize](https://avatars.githubusercontent.com/u/61468406?v=4)](https://github.com/juulrecognize "juulrecognize (2 commits)")[![kerihenare](https://avatars.githubusercontent.com/u/181816?v=4)](https://github.com/kerihenare "kerihenare (2 commits)")[![netbull](https://avatars.githubusercontent.com/u/2797954?v=4)](https://github.com/netbull "netbull (2 commits)")[![NicolasBadey](https://avatars.githubusercontent.com/u/639268?v=4)](https://github.com/NicolasBadey "NicolasBadey (2 commits)")[![sfdumi](https://avatars.githubusercontent.com/u/3295012?v=4)](https://github.com/sfdumi "sfdumi (2 commits)")

---

Tags

symfonymobile 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/kematjaya-mobile-detect-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/kematjaya-mobile-detect-bundle/health.svg)](https://phpackages.com/packages/kematjaya-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)[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)[spomky-labs/pwa-bundle

Progressive Web App Manifest Generator Bundle for Symfony.

6144.4k1](/packages/spomky-labs-pwa-bundle)[kilik/table

Symfony Ajax Datagrid Bundle for doctrine entities

3361.4k](/packages/kilik-table)

PHPackages © 2026

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