thytanium/agent
最新稳定版本:v2.0.1
Composer 安装命令:
composer require thytanium/agent
包简介
User-Agent class ported from CodeIgniter to Laravel
README 文档
README
For Laravel
User-Agent class ported from CodeIgniter to Laravel. It provides specific information about the user agents making requests to your app.
This project is based on CodeIgniter's User_Agent class.
Install
-
Edit the
requiresection in yourcomposer.jsonfileLaravel 4
"require": { "thytanium/agent": "1.*" }
Laravel 5
"require": { "thytanium/agent": "2.*" }
-
Run
composer update -
Edit
app/config/app.php'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.
Links
统计信息
- 总下载量: 100
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-02-11