Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

How do I switch website desktop/mobile mode by using Laravel Agent

I'm using Laravel architecture to develop system. i use the way below in blade to achieve RWD.

@if(Agent::isMobile())
  //SHOW SOME CODE
@elseif(Agent::isDesktop())
  //SHOW SOME CODE
@endif

ps. i use https://github.com/jenssegers/agent to detect

my question is: i want to add a switch button in blade to switch mobile mode to desktop mode. how can i do? i found some information that to change user agent. i change successful by using javascript, but when i reload page, it still detect as mobile.

enter image description here

Comments