FilamentF
Filament10mo ago
Hedi

Getting screen size inside filamentphp?

hello, so i'm trying to make filamentphp usable on mobile, obviously filament being a legendary framework and all that, already had Split and Stack made for this purpose.
but there's only one problem, whenever i use Stack and Split, it removes the table headers, which is understandable considering how table works but it doesn't look good at all.

so i had an idea, if i make a function that returns a list of columns, it returns a list that has no Split/Stack for wide screens, but returns the mobile-friendly columns on smaller screens. the only problem is, there's no easy way to get screen size on php, i was thinking, is there any filament helper that could potentially make this easier?
Solution
i look at this problem a different way, instead of using screen size to determine if the user is using mobile or wide screen, i just decided to use useragent and check if the user is mobile with this package
https://packagist.org/packages/jenssegers/agent
Desktop/mobile user agent parser with support for Laravel, based on Mobiledetect
Was this page helpful?