Download the PHP package torkashvand/laravel-minidevicedetector without Composer
On this page you can find all versions of the php package torkashvand/laravel-minidevicedetector. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download torkashvand/laravel-minidevicedetector
More information about torkashvand/laravel-minidevicedetector
Files in torkashvand/laravel-minidevicedetector
Package laravel-minidevicedetector
Short Description 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.
License MIT
Homepage https://github.com/torkashvand/laravel-minidevicedetector
Informations about the package laravel-minidevicedetector
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, and modified for PHP.
The following is added to the request:
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
$request->isTouchDevice
true
for devices that use touch events.
Wide Device
$request->isWideDevice
true
for devices that are wider than a common mobile phone. This covers tablets and desktop browsers.
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
$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:
Of course this middleware can also be applied to a bunch of routes:
Install
You can install the package via composer:
Next, you must install the service provider:
Next, the \Torkashvand\MiniDeviceDetector\Middleware\MiniDeviceDetector::class
-middleware must be registered in the kernel:
Naming the middleware mini-detector
is just a suggestion. You can give it any name you'd like.
Usage
Detecting device type
Change log
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
License
The MIT License (MIT). Please see License File for more information.