2017 © Pedro Peláez
 

library agent

User-Agent class ported from CodeIgniter to Laravel

image

thytanium/agent

User-Agent class ported from CodeIgniter to Laravel

  • Tuesday, March 10, 2015
  • by thytanium
  • Repository
  • 1 Watchers
  • 2 Stars
  • 36 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 6 Versions
  • 3 % Grown

The README.md

User Agent

For Laravel

User-Agent class ported from CodeIgniter to Laravel. It provides specific information about the user agents making requests to your app., (*1)

This project is based on CodeIgniter's User_Agent class., (*2)

Install

  1. Edit the require section in your composer.json file, (*3)

    Laravel 4

    "require": {
        "thytanium/agent": "1.*"
    }
    

    Laravel 5

    "require": {
        "thytanium/agent": "2.*"
    }
    
  2. Run composer update, (*4)

  3. Edit app/config/app.php, (*5)

    'providers' => array(
        ...
        'Thytanium\Agent\AgentServiceProvider',
    );
    
    ...
    
    'aliases' array(
        ...
        'Agent' => 'Thytanium\Agent\Facades\Agent',
    );
    

Use

Browser

$browser = Agent::browser() //Firefox, Chrome, etc.

Browser version

$version = Agent::version() //35.0, 34.0, etc.

Platform

$platform = Agent::platform() //Windows 8, Windows XP, Linux, MacOS X

Mobile

$mobile = Agent::mobile() //iPhone, iPad, PlayStation 3, Android

Robot

$robot = Agent::robot() //Googlebot, Bing, Yahoo

Accepted languages

$languages = Agent::languages() //en-us, es-ar, en-gb

Accepted charsets

$charsets = Agent::charsets() //utf-8, iso-8859-1

Is it a browser?

$browser = Agent::isBrowser() //true or false

Is it a robot?

$robot = Agent::isRobot() //true or false

Is it a mobile?

$mobile = Agent::isMobile() //true or false

Is it a desktop?

$desktop = Agent::isDesktop() //true or false

Accepts language?

$language = Agent::acceptLanguage('en') //true or false

Accepts charset?

$charset = Agent::acceptCharset('utf-8') //true or false

Contributing

Feel free to contribute to this little project., (*6)

The Versions

10/03 2015

dev-l4

dev-l4

User-Agent class ported from CodeIgniter to Laravel

  Sources   Download

MIT

The Requires

 

by Alejandro González

10/03 2015

v1.0.1

1.0.1.0

User-Agent class ported from CodeIgniter to Laravel

  Sources   Download

MIT

The Requires

 

by Alejandro González

10/03 2015

dev-master

9999999-dev

User-Agent class ported from CodeIgniter to Laravel

  Sources   Download

MIT

The Requires

 

by Alejandro González

10/03 2015

v2.0.1

2.0.1.0

User-Agent class ported from CodeIgniter to Laravel

  Sources   Download

MIT

The Requires

 

by Alejandro González

14/02 2015

v2.0

2.0.0.0

User-Agent class ported from CodeIgniter to Laravel

  Sources   Download

MIT

The Requires

 

by Alejandro González

12/02 2015

v1.0

1.0.0.0

User-Agent class ported from CodeIgniter to Laravel

  Sources   Download

MIT

The Requires

 

by Alejandro González