agent
agent copied to clipboard
Call to undefined method
With Laravel 5 and Jenssegers installed you get this error:
Call to undefined method Jenssegers\Agent\Facades\Agent::platform()
Request code:
$agent = new \Agent;
return $agent->platform();
If I call it statically it returns false.
return \Agent::browser($request->header('user-agent'));
Note: this is a clean install with the latest Lavarvel 5.2.x and jenssegers/agent (v2.3.3)
+1
Can you try Agent::browser()
?
It's working with Agent::browser()
. Thank You!
hi i have same issue Call to undefined method Jenssegers\Agent\Facades\Agent::browser() i try with laravel 5.2 in php 5.5
its works with php7 $headers = $request->headers->all(); $UserAgent=$request->header('user-agent'); Agent::setUserAgent($UserAgent); Agent::setHttpHeaders($headers);
return Agent::browser();