承接 vuthaihoc/laravel-user-device 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

vuthaihoc/laravel-user-device

Composer 安装命令:

composer require vuthaihoc/laravel-user-device

包简介

A modern Laravel package replacing jenssegers/agent, acting as a wrapper for MobileDetect.

README 文档

README

A modern Laravel package replacing jenssegers/agent, acting as a lightweight wrapper around mobiledetect/mobiledetectlib v4. It maintains backwards compatibility with \Agent::... calls by providing the same facade methods.

Requirements

  • PHP >= 8.2
  • Laravel 12.0 or 13.0+
  • mobiledetect/mobiledetectlib ^4.0

Installation

You can install the package via composer:

composer require vuthaihoc/laravel-user-device

Configuration

The package automatically registers its ServiceProvider and Facade thanks to Laravel Package Discovery. No additional configuration is needed.

Usage

You can use the \Agent facade directly in your Laravel application just like you did with jenssegers/agent:

// Basic device detection
$device = \Agent::device(); // Returns device name or false
$robot = \Agent::robot();   // Returns robot name or false

// MobileDetect methods (forwarded dynamically)
\Agent::isMobile();
\Agent::isTablet();
\Agent::is('iPhone');
\Agent::getUserAgent();

// Legacy methods compatibility
\Agent::getBrowsers();
\Agent::getOperatingSystems();
\Agent::getPlatforms();
\Agent::getDesktopDevices();
\Agent::getDetectionRulesExtended();
\Agent::getScriptVersion();

Included Compatibility Methods

This package implements or forwards the following methods to ensure a smooth transition from jenssegers/agent:

  • device()
  • robot()
  • getDetectionRulesExtended()
  • getBrowsers()
  • getOperatingSystems()
  • getPlatforms()
  • getDesktopDevices()
  • getProperties()
  • getScriptVersion()
  • getPhoneDevices()
  • getTabletDevices()
  • getUserAgents()
  • getUtilities()
  • getMobileDetectionRules()

License

The MIT License (MIT).

统计信息

  • 总下载量: 35
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2026-05-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固