PHP code example of tanthammar / livewire-window-size
1. Go to this page and download the library: Download tanthammar/livewire-window-size library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
tanthammar / livewire-window-size example snippets
if(windowXs() || mobileDevice()) {
//execute a tiny Eloquent query and return a minimalistic view
}
if(window2xl()) {
//execute a huge Eloquent query and return a gigantic view
}
//Mobile device detection based on request header.
mobileDevice()
//Browser width, with example values
windowWidthLessThan(400)
windowWidthGreaterThan(399)
windowWidthBetween(400, 1500)
//Browser height, with example values
windowHeightLessThan(500)
windowHeightGreaterThan(499)
windowHeightBetween(400, 900)
//Breakpoints based on config values
windowXs()
windowSm()
windowMd()
windowLg()
windowXl()
window2xl()
if(windowXs()) {
//execute a tiny Eloquent query and return a minimalistic view
}
if(window2xl()) {
//execute a huge Eloquent query and return a gigantic view
}
use Tanthammar\LivewireWindowSize\HasBreakpoints;
class Foo extends \Livewire\Component
{
use HasBreakpoints;
...
}