Implemented first mobile detected route:)
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user