[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-8376":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":32,"readmeContent":33,"aiSummary":34,"trendingCount":16,"starSnapshotCount":16,"syncStatus":35,"lastSyncTime":36,"discoverSource":37},8376,"agent","jenssegers\u002Fagent","jenssegers","👮 A PHP desktop\u002Fmobile user agent parser with support for Laravel, based on Mobiledetect","https:\u002F\u002Fjenssegers.com",null,"PHP",4807,526,86,81,0,4,31,1,30.17,"MIT License",false,"master",true,[26,27,28,29,30,31],"accept-language","browser","mobile-detect","platform","robot","user-agent","2026-06-12 02:01:52","Agent\n=====\n\n[![Latest Stable Version](http:\u002F\u002Fimg.shields.io\u002Fpackagist\u002Fv\u002Fjenssegers\u002Fagent.svg)](https:\u002F\u002Fpackagist.org\u002Fpackages\u002Fjenssegers\u002Fagent) [![Total Downloads](http:\u002F\u002Fimg.shields.io\u002Fpackagist\u002Fdm\u002Fjenssegers\u002Fagent.svg)](https:\u002F\u002Fpackagist.org\u002Fpackages\u002Fjenssegers\u002Fagent) [![Build Status](http:\u002F\u002Fimg.shields.io\u002Ftravis\u002Fjenssegers\u002Fagent.svg)](https:\u002F\u002Ftravis-ci.org\u002Fjenssegers\u002Fagent) [![Coverage Status](http:\u002F\u002Fimg.shields.io\u002Fcoveralls\u002Fjenssegers\u002Fagent.svg)](https:\u002F\u002Fcoveralls.io\u002Fr\u002Fjenssegers\u002Fagent) [![Donate](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdonate-paypal-blue.svg)](https:\u002F\u002Fwww.paypal.me\u002Fjenssegers)\n\nA PHP desktop\u002Fmobile user agent parser with support for Laravel, based on [Mobile Detect](https:\u002F\u002Fgithub.com\u002Fserbanghita\u002FMobile-Detect) with desktop support and additional functionality.\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Fjenssegers.com\u002Fstatic\u002Fmedia\u002Fagent.png\" height=\"275\">\n\u003C\u002Fp>\n\nInstallation\n------------\n\nInstall using composer:\n\n```bash\ncomposer require jenssegers\u002Fagent\n```\n\nLaravel (optional)\n------------------\n\nAdd the service provider in `config\u002Fapp.php`:\n\n```php\nJenssegers\\Agent\\AgentServiceProvider::class,\n```\n\nAnd add the Agent alias to `config\u002Fapp.php`:\n\n```php\n'Agent' => Jenssegers\\Agent\\Facades\\Agent::class,\n```\n\nBasic Usage\n-----------\n\nStart by creating an `Agent` instance (or use the `Agent` Facade if you are using Laravel):\n\n```php\nuse Jenssegers\\Agent\\Agent;\n\n$agent = new Agent();\n```\n\nIf you want to parse user agents other than the current request in CLI scripts for example, you can use the `setUserAgent` and `setHttpHeaders` methods:\n\n```php\n$agent->setUserAgent('Mozilla\u002F5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit\u002F537.13+ (KHTML, like Gecko) Version\u002F5.1.7 Safari\u002F534.57.2');\n$agent->setHttpHeaders($headers);\n```\n\nAll of the original [Mobile Detect](https:\u002F\u002Fgithub.com\u002Fserbanghita\u002FMobile-Detect) methods are still available, check out some original examples at https:\u002F\u002Fgithub.com\u002Fserbanghita\u002FMobile-Detect\u002Fwiki\u002FCode-examples\n\n### Is?\n\nCheck for a certain property in the user agent.\n\n```php\n$agent->is('Windows');\n$agent->is('Firefox');\n$agent->is('iPhone');\n$agent->is('OS X');\n```\n\n### Magic is-method\n\nMagic method that does the same as the previous `is()` method:\n\n```php\n$agent->isAndroidOS();\n$agent->isNexus();\n$agent->isSafari();\n```\n\n### Mobile detection\n\nCheck for mobile device:\n\n```php\n$agent->isMobile();\n$agent->isTablet();\n```\n\n### Match user agent\n\nSearch the user agent with a regular expression:\n\n```php\n$agent->match('regexp');\n```\n\nAdditional Functionality\n------------------------\n\n### Accept languages\n\nGet the browser's accept languages. Example:\n\n```php\n$languages = $agent->languages();\n\u002F\u002F ['nl-nl', 'nl', 'en-us', 'en']\n```\n\n### Device name\n\nGet the device name, if mobile. (iPhone, Nexus, AsusTablet, ...)\n\n```php\n$device = $agent->device();\n```\n\n### Operating system name\n\nGet the operating system. (Ubuntu, Windows, OS X, ...)\n\n```php\n$platform = $agent->platform();\n```\n\n### Browser name\n\nGet the browser name. (Chrome, IE, Safari, Firefox, ...)\n\n```php\n$browser = $agent->browser();\n```\n\n### Desktop detection\n\nCheck if the user is using a desktop device.\n\n```php\n$agent->isDesktop();\n```\n\n*This checks if a user is not a mobile device, tablet or robot.*\n\n### Phone detection\n\nCheck if the user is using a phone device.\n\n```php\n$agent->isPhone();\n```\n\n### Robot detection\n\nCheck if the user is a robot. This uses [jaybizzle\u002Fcrawler-detect](https:\u002F\u002Fgithub.com\u002FJayBizzle\u002FCrawler-Detect) to do the actual robot detection.\n\n```php\n$agent->isRobot();\n```\n\n### Robot name\n\nGet the robot name.\n\n```php\n$robot = $agent->robot();\n```\n\n### Browser\u002Fplatform version\n\nMobileDetect recently added a `version` method that can get the version number for components. To get the browser or platform version you can use:\n\n```php\n$browser = $agent->browser();\n$version = $agent->version($browser);\n\n$platform = $agent->platform();\n$version = $agent->version($platform);\n```\n\n*Note, the version method is still in beta, so it might not return the correct result.*\n\n## License\n\nLaravel User Agent is licensed under [The MIT License (MIT)](LICENSE).\n\n## Security contact information\n\nTo report a security vulnerability, follow [these steps](https:\u002F\u002Ftidelift.com\u002Fsecurity).\n","jenssegers\u002Fagent 是一个基于 Mobiledetect 的 PHP 桌面和移动用户代理解析库，支持 Laravel。该项目能够解析请求中的 User-Agent 字符串，以识别浏览器、操作系统、设备类型等信息，并提供了一系列便捷的方法来检测这些属性。其核心功能包括但不限于：判断是否为特定平台或浏览器、检查是否为移动设备或平板电脑、获取设备名称及操作系统信息等。此外，它还支持自定义 User-Agent 和 HTTP 头部信息的设置，使得在 CLI 环境下也能灵活使用。适用于需要根据不同客户端特性调整响应内容的 Web 应用场景，特别是那些已经采用 Laravel 作为后端框架的项目。",2,"2026-06-11 03:17:37","top_language"]