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

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

nxtcode/laravel-mobile-detect
=============================

Instant mobile detection access directly from within Blade templates.

02PHP

Since Aug 29Pushed 4y agoCompare

[ Source](https://github.com/NxtCodeCom/laravel-mobile-detection-blade)[ Packagist](https://packagist.org/packages/nxtcode/laravel-mobile-detect)[ RSS](/packages/nxtcode-laravel-mobile-detect/feed)WikiDiscussions main Synced 6d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Mobile Detection in Blade
=================================

[](#laravel-mobile-detection-in-blade)

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 NxtCode/laravel-mobile-detect
```

### Laravel 5.4 or earlier

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

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

```
NxtCode\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' => NxtCode\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)

DevicedirectivesDestkop devices`@desktop`, `@elsedesktop`, `@enddesktop`Mobile and tablet`@handheld`, `@elsehandheld`, `@endhandheld`tablet devices`@tablet`, `@elsetablet`, `@endtablet`Non-tablet (desktop or mobile) devices`@nottablet`, `@elsenottablet`, `@endnottablet`Mobile devices`@mobile`, `@elsemobile`, `@endmobile`Non-mobile (desktop or tablet) devices`@notmobile`, `@elsenotmobile`, `@endnotmobile`iOS platforms`@ios`, `@elseios`, `@endios`Android platforms`@android`, `@elseandroid`, `@endandroid`The usage of `@else...` directives are optional.

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/89665607?v=4)[Vinay Choudhary](/maintainers/MadCrypt)[@MadCrypt](https://github.com/MadCrypt)

---

Top Contributors

[![MadCrypt](https://avatars.githubusercontent.com/u/89665607?v=4)](https://github.com/MadCrypt "MadCrypt (13 commits)")

### Embed Badge

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

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

###  Alternatives

[proget-hq/apple-activation-lock

Library for generating Apple Activation Lock Bypass key and hash

6515.8k](/packages/proget-hq-apple-activation-lock)[statamic/migrator

4426.2k](/packages/statamic-migrator)[saadj55/filament-copyable

Filament fields and columns with copyable values

365.6k](/packages/saadj55-filament-copyable)

PHPackages © 2026

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