• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

unicodeveloper/laravel-identify: Laravel 5 Package to Detect Users Browsers, Dev ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

unicodeveloper/laravel-identify

开源软件地址(OpenSource Url):

https://github.com/unicodeveloper/laravel-identify

开源编程语言(OpenSource Language):

PHP 100.0%

开源软件介绍(OpenSource Introduction):

laravel-identify

Latest Stable Version License Build Status Coveralls Quality Score Total Downloads

Laravel 5 Package to identify a User's Browser, Operating System, Language and Device

Installation

PHP 7.1+ or HHVM 3.3+, and Composer are required.

To get the latest version of Laravel Identify, simply add the following line to the require block of your composer.json file.

"unicodeveloper/laravel-identify": "1.7.*"

You'll then need to run composer install or composer update to download it and have the autoloader updated.

  • If you're on Laravel 5.5 or above, that's all you need to do! Check out the usage examples below.
  • If you're on Laravel < 5.5, you'll need to register the service provider once the package is installed. Open up config/app.php and add the following to the providers array:
  • Unicodeveloper\Identify\IdentifyServiceProvider::class

Also, register the Facade like so:

'aliases' => [
    ...
    'Identify' => Unicodeveloper\Identify\Facades\IdentifyFacade::class,
    ...
]

Configuration

To get started, you'll need to publish all vendor assets:

$ php artisan vendor:publish --provider="Unicodeveloper\Identify\IdentifyServiceProvider"

Browser Detection

The browser method allows you to detect a user's browser and version.

Browsers Detected

  • Vivaldi
  • Opera
  • Opera Mini
  • WebTV
  • Internet Explorer
  • Pocket Internet Explorer
  • Microsoft Edge
  • Konqueror
  • iCab
  • OmniWeb
  • Firebird
  • Firefox
  • Iceweasel
  • Shiretoko
  • Mozilla
  • Amaya
  • Lynx
  • Safari
  • Chrome
  • Navigator
  • GoogleBot
  • Yahoo! Slurp
  • W3C Validator
  • BlackBerry
  • IceCat
  • Nokia S60 OSS Browser
  • Nokia Browser
  • MSN Browser
  • MSN Bot
  • Netscape Navigator
  • Galeon
  • NetPositive
  • Phoenix
  • SeaMonkey
  • Yandex Browser

Usage

/**
 * Gets the version of the user's browser
 * @return string
 */
Identify::browser()->getVersion()

/**
 * Gets the name of the user's browser
 * @return string
 */
Identify::browser()->getName()

OS Detection

The os method allows you to detect a user's operating system and version.

OS Detected

  • Windows
  • Windows Phone
  • OS X
  • iOS
  • Android
  • Chrome OS
  • Linux
  • SymbOS
  • Nokia
  • BlackBerry
  • FreeBSD
  • OpenBSD
  • NetBSD
  • OpenSolaris
  • SunOS
  • OS2
  • BeOS

Usage

/**
 * Gets the version of the user's Operating System
 * @return string
 */
Identify::os()->getVersion()

/**
 * Gets the name of the user's Operating System
 * @return string
 */
Identify::os()->getName()

Device Detection

The device method allows you to detect a user's device.

Device Detected

  • iPad
  • iPhone
  • Windows Phone

Usage

/**
 * Gets the name of the user's device
 * @return string
 */
Identify::device()->getName()

Language Detection

The language method allows you to detect a user's language.

Usage

/**
 * Gets the language that the user's browser contents are displayed in
 * @return string
 */
Identify::lang()->getLanguage()

Contributing

Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.

How can I thank you?

Why not star the github repo? I'd love the attention! Why not share the link for this repository on Twitter or HackerNews? Spread the word!

Don't forget to follow me on twitter!

Thanks! Prosper Otemuyiwa.

License

The MIT License (MIT). Please see License File for more information.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap