PHPackages                             riverskies/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. riverskies/laravel-mobile-detect

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

riverskies/laravel-mobile-detect
================================

Instant mobile detection access directly from within Blade templates.

1.3(8y ago)2361.4M—0.1%32[1 PRs](https://github.com/riverskies/laravel-mobile-detect/pulls)7MITPHP

Since May 20Pushed 3y ago11 watchersCompare

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

READMEChangelog (1)Dependencies (5)Versions (8)Used By (7)

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

47

—

FairBetter than 94% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity58

Moderate usage in the ecosystem

Community26

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 92% 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 ~78 days

Recently: every ~41 days

Total

7

Last Release

3181d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c95f579c623c6c7fe0a5015831ab0bb9e81cf8793dad215ffca8f5bd017872e?d=identicon)[barnabaskecskes](/maintainers/barnabaskecskes)

---

Top Contributors

[![barnabaskecskes](https://avatars.githubusercontent.com/u/3535449?v=4)](https://github.com/barnabaskecskes "barnabaskecskes (23 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

laravellaravel-5-packagemobile-detectlaravelblademobiledetection

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[radic/blade-extensions

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

271321.7k5](/packages/radic-blade-extensions)

PHPackages © 2026

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