ideato/cloudfront-device-detect

Detect devices based on CloudFront caching headers

1.0.1 2018-05-07 18:40 UTC

This package is auto-updated.

Last update: 2024-12-09 23:51:48 UTC


README

Detect devices based on CloudFront caching headers. More info on CloudFront headers are available here.

How to use

$detector = new \CloudFrontDeviceDetect\Detector();

$detector->isDesktop();
$detector->isDesktopOrTablet();
$detector->isMobile();
$detector->isTablet();
$detector->isSmartTV();
$detector->isMobileOrTablet();

Helpers

If you want to use the library with default settings you can use helper functions as follows:

use CloudFrontDeviceDetect;

isDesktop();
isDesktopOrTablet();
isMobile();
isTablet();
isSmartTV();
isMobileOrTablet();

Requirements

PHP 7.1 or above

Authors

License

The library is licensed under the MIT License