$user_agent = request()->header('user-agent'); if (false !== stripos($user_agent, 'MSIE')) { $user_browser = 'MSIE'; } elseif (false !== stripos($user_agent, 'Firefox')) { $user_browser = 'Firefox'; } elseif (false !== stripos($user_agent, 'Chrome')) { $user_browser = 'Chrome'; } elseif (false !== stripos($user_agent, 'Safari')) { $user_browser = 'Safari'; } elseif (false !== stripos($user_agent, 'Opera')) { $user_browser = 'Opera'; } else { $user_browser = 'Other'; } return $user_browser;