How To Get Client DOM Width In Laravel PHP
I don't know if this is even possible, but I'd appreciate any help.
- How do I get the client's DOM width in Laravel?
- Basically, is there a way to extract the client's screen width from the
- Or are there any functions in Laravel or Blade that will give me a screen width value?
I know that I can get the DOM width with jQuery
$(document).width(), but I need the width value on server side; before any js is executed.
Laravel. When user visits your website, get the screen size with JS (
window.width) and store it in a cookie
$screen = Cookie::get('screen');
$screen = explode("x", $screen); $width = $screen $height = $screen;
This is 1 solution to do it.
Unfortunately the is no way to get screen size info from PHP. You can try to play around with User Agent and detect if it is a mobile or desktop or tablet. and way to get screen size info from PHP. You can try to play around with User Agent and detect if it is a mobile or desktop or tablet. and make fix sizes for those 3 types.
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → October CMS - Conditionally Load a Different Page
- → How to disable assets combining on development in OctoberCMS
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → OctoberCms component: How to display all ID(items) instead of sorting only one ID?
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?