【问题标题】:How i check Request from Mobile App or WEB我如何检查来自移动应用程序或 WEB 的请求
【发布时间】:2016-02-06 07:12:56
【问题描述】:

我需要使用 LAREVEL 检查请求是否来自移动应用(Android 或 IOS)或 WEB。

我正在使用 $value = \Request::header('Content-Type'); 它返回

应用程序/x-www-form-urlencoded

那么我如何检测请求来源?

【问题讨论】:

  • 您究竟为什么需要这种检测?

标签: php api laravel


【解决方案1】:

看看这个https://github.com/jenssegers/agent

使用很简单,阅读文档。

$agent->is('Windows');
$agent->is('Firefox');
$agent->is('iPhone');
$agent->is('OS X');

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-14
    • 1970-01-01
    • 2018-04-03
    • 2015-10-07
    相关资源
    最近更新 更多