jenssegers / agent

👮 A PHP desktop/mobile user agent parser with support for Laravel, based on Mobiledetect
https://jenssegers.com
MIT License
4.53k stars 473 forks source link

Magic method device_type #187

Open suvires opened 3 years ago

suvires commented 3 years ago

Nowadays to save the device type i have to do:

        if($agent->isDesktop()) {
            $scan->device_type = 'Desktop';
        } elseif ($agent->isPhone()) {
            $scan->device_type = 'Phone';
        } elseif ($agent->isTablet()) {
            $scan->device_type = 'Tablet';
        }

It would be usefull a magic method device type.

Thanks!