I am working in PHP, specifically Laravel.
I want to show different views according to how big the user's screen is (ex: mobile or pc). In simple words, here is what I want my routing to look like:
if (device == mobile){
Route::view('/', 'mobile_ui');
} else {
Route::view('/', 'desktop_ui');
}
Let me clarify that this question is not about responsive design. I just want to use two different UI templates; one for the mobile and one for the desktop.
EDIT: As pointed out by @rickdenhaan in the comments, the answer to this question can be found here: Simplest way to detect a mobile device