Ekapp/skolehjem/app/Helpers/Detector.php

23 lines
375 B
PHP

<?php
namespace App\Helpers;
use Jenssegers\Agent\Agent;
class Detector
{
public static function View($viewName, $args) {
$agent = new Agent();
if($agent->isMobile()) {
return view(config("detector.mobilePath") . "." . $viewName, $args);
}
return view(config("detector.defaultPath") . "." . $viewName, $args);
}
}