Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

detect mobile device laravel

<?php

use JenssegersAgentAgent as Agent;
$Agent = new Agent();
// agent detection influences the view storage path
if ($Agent->isMobile()) {
    // you're a mobile device
    $viewPath = __DIR__.'/../mobile';
} else {
    // you're a desktop device, or something similar
    $viewPath = __DIR__.'/../views';
}


return array(
    'paths' => array($viewPath),
    .....
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #detect #mobile #device #laravel
ADD COMMENT
Topic
Name
9+7 =