larapack / mobiledetect by marktopper

Laravel package for MobileDetect
312
4
2
Package Data
Maintainer Username: marktopper
Maintainer Contact: hi@webman.io (Mark Topper)
Package Create Date: 2014-12-01
Package Last Update: 2018-02-05
Home Page: https://ulties.com
Language: PHP
License: Unknown
Last Refreshed: 2024-12-18 03:04:10
Package Statistics
Total Downloads: 312
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 4
Total Watchers: 2
Total Forks: 3
Total Open Issues: 0

MobilDetect package for Laravel

Build Status Total Downloads Latest Stable Version Latest Unstable Version License

Info

Version: 1.0
Author: Mark Topper [Facebook] [Github] [Twitter]
Website: www.webman.io
Email: mark@webman.io

Installation

First add the package to your composer by running command composer require larapack/mobiledetect 1.* or by adding the following code to composer.json followed by running the command composer update:

{
    "require": {
        "larapack/mobiledetect": "1.*"
    }
}

Add the alias to the aliases in your app/config/app.php:

'aliases' => array(
    // ...
    'MobileDetect' => 'Larapack\MobileDetect\MobileDetect',
)

Usage

The following examples assume you use the MobileDetect class name as alias, but the packages is namespaced so you can name the facade as you wish.

$detect = MobileDetect;

if ($detect->isMobile()){
  // this is a mobile
}
else if ($detect->isTablet()){
  // this is a tablet
}

if ($detect->isIE()){
  // this is IE -.-'
}

More examples on http://mobiledetect.net/