Skip to content
[No longer maintained] Laravel package for MobileDetect
Branch: master
Clone or download
Pull request Compare This branch is even with larapack:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/Larapack/MobileDetect Update and rename src/MarkTopper/MobileDetect/MobileDetect.php to src… Jun 10, 2015
tests
.travis.yml Create .travis.yml Dec 2, 2014
LICENSE
README.md
composer.json
phpunit.xml Initial Release Dec 1, 2014

README.md

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/

You can’t perform that action at this time.