jenssegers / agent

👮 A PHP desktop/mobile user agent parser with support for Laravel, based on Mobiledetect
https://jenssegers.com
MIT License
4.48k stars 472 forks source link

how i can set custom agent #186

Open vahidalvandi opened 3 years ago

vahidalvandi commented 3 years ago

i need custom agent with name mobile web view app because i need hidden same menu in mobile web view and show in mobile browser ??

jangaraev commented 2 years ago

You can always pass the user-agent string on class instantiation, like this:

use Jenssegers\Agent\Agent;

$agent = new Agent(null, 'mobile web view app');

also, there is another option to pass custom user-agent to specific methods:

$agent = app()->make('agent');
// $agent = \Illuminate\Support\Facades\App::make('agent');

$isMobile = Agent::isMobile('mobile web view app'); // your custom user-agent string

Hope I get your requirement right.