PHPackages                             kwenziwa/devicedetector - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. kwenziwa/devicedetector

ActivePackage

kwenziwa/devicedetector
=======================

Device Detector is a versatile, easy-to-use package for project that provides seamless device and operating system detection. Leveraging the robustness of mobiledetect/mobiledetectlib, this package allows developers to quickly identify whether a user is accessing their application from a mobile device, tablet, or desktop and determine the operating system, such as iOS or Android.

1.0.1(2y ago)114MITPHPPHP ^7.3|^8.0

Since Jan 28Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Kwenziwa/device-detector)[ Packagist](https://packagist.org/packages/kwenziwa/devicedetector)[ RSS](/packages/kwenziwa-devicedetector/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Device Detector
===============

[](#device-detector)

Device Detector is a convenient package for applications, offering easy detection of user devices and their operating systems. Utilizing the `mobiledetect/mobiledetectlib` library, this package enables applications to quickly identify device types (mobile, tablet, desktop) and operating systems (iOS, Android, etc.), enhancing the user experience and providing valuable insights.

Features
--------

[](#features)

- Detect whether the user's device is a mobile, tablet, or desktop
- Identify the operating system of the user's device (iOS, Android, etc.)
- Lightweight and easy to integrate into any project

Installation
------------

[](#installation)

Install the package via composer:

```
composer require kwenziwa/devicedetector
```

Usage
-----

[](#usage)

After installation, you can use the DeviceDetector in your application as follows:

```
use Kwenziwa\DeviceDetector\DeviceDetector;

$deviceDetector = app(DeviceDetector::class);

if ($deviceDetector->isMobile()) {
    // Handle mobile device
}

if ($deviceDetector->isTablet()) {
    // Handle tablet device
}

if ($deviceDetector->isDesktop()) {
    // Handle desktop device
}
```

Methods
-------

[](#methods)

### `isMobile()`

[](#ismobile)

Determines if the user's device is a mobile phone.

```
$deviceDetector->isMobile();
```

### `isTablet()`

[](#istablet)

Determines if the user's device is a tablet.

```
$deviceDetector->isTablet();
```

### `isDesktop()`

[](#isdesktop)

Determines if the user's device is a desktop. This is typically the default if the device is neither a mobile nor a tablet.

```
$deviceDetector->isDesktop();
```

### `isIOS()`

[](#isios)

Checks if the user's device is running iOS.

```
$deviceDetector->isIOS();
```

### `isAndroidOS()`

[](#isandroidos)

Checks if the user's device is running Android OS.

```
$deviceDetector->isAndroidOS();
```

### `getDeviceType()`

[](#getdevicetype)

Returns the type of the user's device as a string ('mobile', 'tablet', or 'desktop').

```
$deviceType = $deviceDetector->getDeviceType();
```

### `getOSType()`

[](#getostype)

Returns the operating system of the user's device as a string (e.g., 'iOS', 'Android', 'Windows Mobile', 'BlackBerry', 'Symbian', or 'Unknown').

```
$osType = $deviceDetector->getOSType();
```

### `getBrowser()`

[](#getbrowser)

Returns the the browser name system of the user's device as a string.

```
$detector = new DeviceDetector();

$browser = $detector->getBrowser();
echo "Browser: $browser";
```

Run the Tests
-------------

[](#run-the-tests)

Run the tests using the PHPUnit command:

```
./vendor/bin/phpunit
```

This command will execute all tests in your tests directory. The above tests are basic and might not effectively cover all scenarios since the actual device type and OS will depend on the environment where the tests are run. In a more comprehensive test suite, you would mock the MobileDetect class to simulate different devices and operating systems. This would allow you to test all branches of your code.

Contributing
------------

[](#contributing)

Contributions are welcome and will be fully credited. We accept contributions via Pull Requests on [Github](https://github.com/Kwenziwa/device-detector).

License
-------

[](#license)

The Device Detector is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

833d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cf73387e122d5d0617c180f7406190d2bb345dd7796e189253b01562fa19f62e?d=identicon)[Kwenziwa](/maintainers/Kwenziwa)

---

Top Contributors

[![Kwenziwa](https://avatars.githubusercontent.com/u/21169712?v=4)](https://github.com/Kwenziwa "Kwenziwa (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kwenziwa-devicedetector/health.svg)

```
[![Health](https://phpackages.com/badges/kwenziwa-devicedetector/health.svg)](https://phpackages.com/packages/kwenziwa-devicedetector)
```

###  Alternatives

[laravel/jetstream

Tailwind scaffolding for the Laravel framework.

4.1k19.8M136](/packages/laravel-jetstream)[jenssegers/agent

Desktop/mobile user agent parser with support for Laravel, based on Mobiledetect

4.8k67.8M440](/packages/jenssegers-agent)[jeffgreco13/filament-breezy

A custom package for Filament with login flow, profile and teams support.

1.0k1.7M41](/packages/jeffgreco13-filament-breezy)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[shetabit/visitor

Laravel visitor

565578.2k8](/packages/shetabit-visitor)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
