Using Log Activity helper class I have done the part ,but the agent data is not correct or is showing demo data. When I am using chrome it shows same data even I use Firefox or another browser. How can I resolve the issue, I want when I am using chrome it gives me chrome, When I am using Firefox it shows me Firefox.
public static function addToLog($subject)
{
$log = [];
$log['subject'] = $subject;
$log['url'] = Request::fullUrl();
$log['method'] = Request::method();
$log['ip'] = Request::ip();
$log['agent'] = Request::header('user-agent');
$log['user_id'] = auth()->check() ? auth()->user()->id : 1;
LogActivityModel::create($log);
}
My Log Activity Helper class is like this.