larapack/mobiledetect

There is no license information available for the latest version (1.0) of this package.

Laravel package for MobileDetect

Installs: 314

Dependents: 0

Suggesters: 0

Security: 0

Stars: 4

Watchers: 1

Forks: 3

Open Issues: 0

pkg:composer/larapack/mobiledetect

1.0 2015-06-10 11:16 UTC

This package is auto-updated.

Last update: 2025-10-06 12:36:42 UTC


README

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/