dev-master
9999999-devLaravel package for MobileDetect
The Requires
by Mark Topper
1.0
1.0.0.0Laravel package for MobileDetect
The Requires
by Mark Topper
Wallogit.com
2017 © Pedro Peláez
Laravel package for MobileDetect
Version: 1.0
Author: Mark Topper [Facebook] [Github] [Twitter]
Website: www.webman.io
Email: mark@webman.io, (*2)
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:, (*3)
{
"require": {
"larapack/mobiledetect": "1.*"
}
}
Add the alias to the aliases in your app/config/app.php:, (*4)
'aliases' => array(
// ...
'MobileDetect' => 'Larapack\MobileDetect\MobileDetect',
)
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., (*5)
$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/, (*6)
Laravel package for MobileDetect
Laravel package for MobileDetect