From cecce44078bae9db1713ac26e70ab52e57b05c89 Mon Sep 17 00:00:00 2001 From: Kei Date: Wed, 15 Nov 2023 02:29:41 +0700 Subject: [PATCH] Update Helper.php --- app/Helpers/Helper.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/Helpers/Helper.php b/app/Helpers/Helper.php index e470edbea..7e3eb285b 100644 --- a/app/Helpers/Helper.php +++ b/app/Helpers/Helper.php @@ -2,20 +2,21 @@ namespace App\Helpers; -use DeviceDetector\DeviceDetector; use Illuminate\Support\Str; use Illuminate\Support\Stringable; use Spatie\Url\Url as SpatieUrl; class Helper { - public static function deviceDetector(): DeviceDetector + /** + * Parse any User Agent + * + * @return \DeviceDetector\DeviceDetector + */ + public static function deviceDetector() { - $dd = new DeviceDetector(request()->userAgent()); - $dd->setCache( - new \DeviceDetector\Cache\LaravelCache - ); - + $dd = new \DeviceDetector\DeviceDetector(request()->userAgent()); + $dd->setCache(new \DeviceDetector\Cache\LaravelCache); $dd->parse(); return $dd;