diff --git a/resources/views/templates/base.blade.php b/resources/views/templates/base.blade.php index d276f2b..9a19f9c 100644 --- a/resources/views/templates/base.blade.php +++ b/resources/views/templates/base.blade.php @@ -2,7 +2,7 @@ @php $page_title = (isset($title) ? $title . ' - ' : '') . env('APP_NAME'); - $device_mobile = preg_match('/Mobi/', Request::header('User-Agent')) || preg_match('/iP(hone|ad|od);/', Request::header('User-Agent')); + $device_mobile = !is_null(Request::header('User-Agent')) && (preg_match('/Mobi/', Request::header('User-Agent')) || preg_match('/iP(hone|ad|od);/', Request::header('User-Agent'))); @endphp