PHPackages                             deguiric/laravel-mobile-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. [Templating &amp; Views](/categories/templating)
4. /
5. deguiric/laravel-mobile-detect

ActiveLibrary[Templating &amp; Views](/categories/templating)

deguiric/laravel-mobile-detect
==============================

Instant mobile detection access directly from within Blade templates.

V1.0.1(2y ago)084MITPHP

Since Jun 19Pushed 2y agoCompare

[ Source](https://github.com/deguiric/laravel-mobile-detect)[ Packagist](https://packagist.org/packages/deguiric/laravel-mobile-detect)[ RSS](/packages/deguiric-laravel-mobile-detect/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (5)Versions (3)Used By (0)

Fork of riverskies/laravel-mobile-detect

Laravel Mobile Detect
=====================

[](#laravel-mobile-detect)

A package that enables you to use device detection right in your Blade templates. (Utilises the well-known, constantly updated [PHP mobile detection library](http://mobiledetect.net/).)

### When would you use this package?

[](#when-would-you-use-this-package)

Responsive CSS may help to make content in the browser look nice on different devices but it won't help you serve responsive content from your backend (at least not the easy way). This can have a really bad knock-on effect on the user experience (have you ever waited for a large image to load while having a bad connection on your mobile?). This package will make it a breeze to serve device-specific content right from your back-end.

### How does this package work?

[](#how-does-this-package-work)

The package implements various Blade directives that you can use to serve different content from your Blade template for different device types.

### Installation

[](#installation)

Install the package through composer:

```
$ composer require riverskies/laravel-mobile-detect
```

### Laravel 5.4 or earlier

[](#laravel-54-or-earlier)

Add the service provider to your **config/app.php** file:

```
Riverskies\Laravel\MobileDetect\MobileDetectServiceProvider::class
```

Optionally, you can add an alias as well if you'd like to use the underlying instance anywhere else (or have access to all the functions):

```
'MobileDetect' => Riverskies\Laravel\MobileDetect\Facades\MobileDetect::class
```

### Usage

[](#usage)

Use the new Blade directives in your template files:

```
@desktop

@elsedesktop

@enddesktop
```

> **NOTE** You might have to run `php artisan view:clear` to have the new Blade directives take effect!

### Available directives

[](#available-directives)

`@desktop`, `@elsedesktop`, `@enddesktop` - for destkop devices

`@handheld`, `@elsehandheld`, `@endhandheld` - for non-desktop (mobile and tablet) devices

`@tablet`, `@elsetablet`, `@endtablet` - for tablet devices

`@nottablet`, `@elsenottablet`, `@endnottablet` - for non-tablet (desktop or mobile) devices

`@mobile`, `@elsemobile`, `@endmobile` - for mobile devices

`@notmobile`, `@elsenotmobile`, `@endnotmobile` - for non-mobile (desktop or tablet) devices

`@ios`, `@elseios`, `@endios` - for iOS platforms

`@android`, `@elseandroid`, `@endandroid` - for Android platforms

The usage of `@else...` directives are optional.

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.9% 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 ~0 days

Total

2

Last Release

745d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9409ddfd9ae2c18b67c1bdfc9041ff48139cd3225c41c36c7c24967b09243144?d=identicon)[phoeniix07](/maintainers/phoeniix07)

---

Top Contributors

[![barnabaskecskes](https://avatars.githubusercontent.com/u/3535449?v=4)](https://github.com/barnabaskecskes "barnabaskecskes (23 commits)")[![deguiric](https://avatars.githubusercontent.com/u/4803711?v=4)](https://github.com/deguiric "deguiric (7 commits)")[![EmilioBravo](https://avatars.githubusercontent.com/u/544288?v=4)](https://github.com/EmilioBravo "EmilioBravo (1 commits)")[![zyuzka](https://avatars.githubusercontent.com/u/12764988?v=4)](https://github.com/zyuzka "zyuzka (1 commits)")

---

Tags

laravelblademobiledetection

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/deguiric-laravel-mobile-detect/health.svg)

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

###  Alternatives

[riverskies/laravel-mobile-detect

Instant mobile detection access directly from within Blade templates.

2361.5M7](/packages/riverskies-laravel-mobile-detect)[radic/blade-extensions

Laravel package providing additional Blade extensions: foreach (with $loop data like twig), break, continue, set,array (multiline), etc

270323.3k5](/packages/radic-blade-extensions)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)

PHPackages © 2026

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