PHPackages                             mews/useragent - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. mews/useragent

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mews/useragent
==============

Useragent Package for Laravel 4

126.1k5PHP

Since Dec 31Pushed 11y ago5 watchersCompare

[ Source](https://github.com/mewebstudio/Useragent)[ Packagist](https://packagist.org/packages/mews/useragent)[ RSS](/packages/mews-useragent/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Useragent for Laravel 4
=======================

[](#useragent-for-laravel-4)

A simple [Laravel 4](http://four.laravel.com/) service provider for including the [Useragent for Laravel 4](https://github.com/mewebstudio/Useragent).

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

[](#installation)

The Useragent Service Provider can be installed via [Composer](http://getcomposer.org) by requiring the `mews/useragent` package and setting the `minimum-stability` to `dev` (required for Laravel 4) in your project's `composer.json`.

```
{
    "require": {
        "laravel/framework": "4.0.*",
        "mews/useragent": "dev-master"
    },
    "minimum-stability": "dev"
}
```

Update your packages with `composer update` or install with `composer install`.

Usage
-----

[](#usage)

To use the Useragent Service Provider, you must register the provider when bootstrapping your Laravel application. There are essentially two ways to do this.

Find the `providers` key in `app/config/app.php` and register the Useragent Service Provider.

```
    'providers' => array(
        // ...
        'Mews\Useragent\UseragentServiceProvider',
    )
```

Find the `aliases` key in `app/config/app.php`.

```
    'aliases' => array(
        // ...
        'Useragent' => 'Mews\Useragent\Facades\Useragent',
    )
```

This example attempts to determine whether the user agent browsing your site is a web browser, a mobile device, or a robot. It will also gather the platform information if it is available.

```
if (Useragent::is_browser())
{
    $agent = Useragent::browser().' '. Useragent::version();
}
elseif (Useragent::is_robot())
{
    $agent = Useragent::robot();
}
elseif (Useragent::is_mobile())
{
    $agent = Useragent::mobile();
}
else
{
    $agent = 'Unidentified User Agent';
}

echo $agent;

echo Useragent::platform(); // Platform info (Windows, Linux, Mac, etc.)

```

Method Reference
================

[](#method-reference)

All methods in the Agent class are the same as the methods in the Codeigniter user agent library. You can read the documentation [http://codeigniter.com/user\_guide](http://codeigniter.com/user_guide)

Note all method calls are static Eg

```
Useragent::is_browser();

```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2125733?v=4)[MeWebStudio - Muharrem ERİN](/maintainers/mewebstudio)[@mewebstudio](https://github.com/mewebstudio)

---

Top Contributors

[![mewebstudio](https://avatars.githubusercontent.com/u/2125733?v=4)](https://github.com/mewebstudio "mewebstudio (6 commits)")[![allebb](https://avatars.githubusercontent.com/u/767628?v=4)](https://github.com/allebb "allebb (1 commits)")[![thujohn](https://avatars.githubusercontent.com/u/580699?v=4)](https://github.com/thujohn "thujohn (1 commits)")

### Embed Badge

![Health badge](/badges/mews-useragent/health.svg)

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

###  Alternatives

[imdbphp/imdbphp

Library for retrieving film and tv information from IMDb

26681.7k2](/packages/imdbphp-imdbphp)[rymanalu/factory-generator

Laravel 5 Model Factory Generator.

178.0k](/packages/rymanalu-factory-generator)

PHPackages © 2026

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