library mobile-detector
Detect mobile devices and user agents.
grottopress/mobile-detector
Detect mobile devices and user agents.
- Thursday, March 1, 2018
- by akadusei
- Repository
- 1 Watchers
- 0 Stars
- 88 Installations
- PHP
- 1 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 4 Versions
- 14 % Grown
Mobile Detector
Description
Detect mobile devices and user agents. This is an extension of the Mobile_Detect library, (*1)
Installation
Install via composer: composer require grottopress/mobile-detector
, (*2)
Usage
use GrottoPress\Mobile\Detector;
$detector = new Detector();
// Check if is iOS
if ($detector->isiOS()) {
//
}
// Check if is android
if ($detector->isAndroidOS()) {
//
}
// Check if is smart device
if ($detector->isSmart()) {
//
}
// Check if is phone
if ($detector->isPhone()) {
//
}
// Check if is tablet
if ($detector->isTablet()) {
//
}
// Check if is Samsung tablet
if ($detector->isSamsungTablet()) {
//
}
// Detect current device
$device = $detector->getDevice();
// Detect current browser
$browser = $detector->getBrowser();
// Detect current OS
$os = $detector->getOperatingSystem();
// More examples here: https://github.com/serbanghita/Mobile-Detect/wiki/Code-examples
Development
Run tests with composer run test
., (*3)
Contributing
- Fork it
- Switch to the
master
branch: git checkout master
- Create your feature branch:
git checkout -b my-new-feature
- Make your changes, updating changelog and documentation as appropriate.
- Commit your changes:
git commit
- Push to the branch:
git push origin my-new-feature
- Submit a new Pull Request against the
GrottoPress:master
branch.
dev-master
9999999-dev
Detect mobile devices and user agents.
Sources
Download
MIT
The Requires
The Development Requires
mobile
dev-dev
dev-dev
Detect mobile devices and user agents.
Sources
Download
MIT
The Requires
The Development Requires
mobile
0.1.1
0.1.1.0
Detect mobile devices and user agents.
Sources
Download
MIT
The Requires
The Development Requires
mobile
0.1.0
0.1.0.0
Detect mobile devices and user agents.
Sources
Download
MIT
The Requires
The Development Requires
mobile