I have a site and I have hosted the site in shared hosting. The thing is it looks great in PC but doesn't look that good in mobile devices. I know I can make it look good with media queries, but I want to deliver the user with a whole new experience. I have seen the thing in Facebook when I open it in PC, it just works good and when I open it in mobile device (cell phone) it asks me to download it for the cell phone. So, how does it know if my device is Android or iOS or PC? I want to do the very same thing in my site. I have a site made with Laravel
and in the view I have:
Route::get('/', 'PagesController@index');
And in my controller what I want to do is:
<?php
if(getDevice($device) === "android"){
return "mobile_view";
}else{
return "pc_view";
}
?>
So, is there a function in php or Laravel
to do that?