$this->hasHeader('USER_AGENT') ? (new Agent())->platform() : null; } /** * Return the browser * * @return Closure */ public function getAgent() { return fn() => $this->hasHeader('USER_AGENT') ? (new Agent())->browser() : null; } /** * Get the user location's based on her/his IP address * * @return Closure */ public function getLocation() { return fn() => geoip()->getLocation($this->getClientIp()); } public function getCurrentToken() { // todo: how to implement ip lookup for current token return fn() => Auth::user()->token; } }