PHPackages                             torkashvand/laravel-minidevicedetector - 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. torkashvand/laravel-minidevicedetector

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

torkashvand/laravel-minidevicedetector
======================================

A middleware that adds attributes to your request object that describe the users browser. This will let you fine tune the templates or code to use based on the traits of the browser.

v1.0.0(9y ago)112MITPHP

Since Dec 23Pushed 7y ago1 watchersCompare

[ Source](https://github.com/torkashvand/laravel-minidevicedetector)[ Packagist](https://packagist.org/packages/torkashvand/laravel-minidevicedetector)[ Docs](https://github.com/torkashvand/laravel-minidevicedetector)[ RSS](/packages/torkashvand-laravel-minidevicedetector/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

About
=====

[](#about)

This middleware package adds attributes to your request object that describe the users browser. This will let you fine tune the templates or code to use based on the traits of the browser.

This project has forked from [django-minidetector](https://github.com/remohammadi/django-minidetector), and modified for PHP.

The following is added to the request:

Simple Device
-------------

[](#simple-device)

```
$request->isSimpleDevice

```

`true` for all non-desktop devices (browsers) without "modern" CSS and JS support. This includes non "smart" phones and simpler browsers like those found on game consoles and the kindle.

Touch Device
------------

[](#touch-device)

```
$request->isTouchDevice

```

`true` for devices that use touch events.

Wide Device
-----------

[](#wide-device)

```
$request->isWideDevice

```

`true` for devices that are wider than a common mobile phone. This covers tablets and desktop browsers.

Device Type
-----------

[](#device-type)

```
    $request->isSimpleDevice
    $request->isTouchDevice
    $request->isWideDevice
    $request->mobile
    $request->isWebkit
    $request->isIOSDevice
    $request->isAndroidDevice
    $request->isWebOSDevice
    $request->isWindowsPhoneDevice

```

`true` if the device is part of the given platform.

These give more granular information about modern smart devices. This is helpful if you want to target features to a specific device type.

Other Attributes
----------------

[](#other-attributes)

```
$request->isWebkit

```

`true` if the browser is webkit (desktop or mobile.)

If you only have certain route that need the distinction all you need to do is adding the middleware to it:

```
Route::get('/need-destination', [
   'middleware'=> 'mini-detector:viewNeedDestination',
   'uses' => 'NeedDestinationController@index',
]);
```

Of course this middleware can also be applied to a bunch of routes:

```
Route::group(['prefix' => 'admin', 'middleware' => 'mini-detector:viewAdmin'], function() {

   //all the controllers of your admin section
   ...

});
```

Install
-------

[](#install)

You can install the package via composer:

```
$ composer require torkashvand/laravel-minidevicedetector
```

Next, you must install the service provider:

```
// config/app.php
'providers' => [
    ...
    Torkashvand\MiniDeviceDetector\MiniDeviceDetectorServiceProvider::class,
];
```

Next, the `\Torkashvand\MiniDeviceDetector\Middleware\MiniDeviceDetector::class`-middleware must be registered in the kernel:

```
//app/Http/Kernel.php
protected $routeMiddleware = [
  ...
  'mini-detector' => \Torkashvand\MiniDeviceDetector\Middleware\MiniDeviceDetector::class,
];
```

Naming the middleware `mini-detector` is just a suggestion. You can give it any name you'd like.

Usage
-----

[](#usage)

### Detecting device type

[](#detecting-device-type)

```
Route::get('/need-destination', ['middleware'=> 'mini-detector','uses' => 'NeedToDetectController@show']);
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity64

Established project with proven stability

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

3427d ago

### Community

Maintainers

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

---

Tags

middlewarelaraveltorkashvandlaravel-minidevicedetectordevicedetector

### Embed Badge

![Health badge](/badges/torkashvand-laravel-minidevicedetector/health.svg)

```
[![Health](https://phpackages.com/badges/torkashvand-laravel-minidevicedetector/health.svg)](https://phpackages.com/packages/torkashvand-laravel-minidevicedetector)
```

###  Alternatives

[timacdonald/has-parameters

A trait that allows you to pass arguments to Laravel middleware in a more PHP'ish way.

228271.7k2](/packages/timacdonald-has-parameters)[reinink/remember-query-strings

Laravel middleware that automatically remembers and restores query strings.

76598.2k3](/packages/reinink-remember-query-strings)[yemenifree/laravel-arabic-numbers-middleware

auto transforms arabic/eastern to eastern/arabic numbers for i.e ١٢٣٤٥٦٧٨ to 12345678

18135.4k](/packages/yemenifree-laravel-arabic-numbers-middleware)[arubacao/aws-ip-range-middleware

Laravel Middleware for Amazon Web Services (AWS) IP Address Range

172.3k](/packages/arubacao-aws-ip-range-middleware)

PHPackages © 2026

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