agent icon indicating copy to clipboard operation
agent copied to clipboard

not working in middleware

Open MeisamSalehi opened this issue 5 years ago • 4 comments

MeisamSalehi avatar Apr 12 '19 14:04 MeisamSalehi

this code not working in middleware

public function handle($request, Closure $next) { $agent = new Agent(); if ($agent->isMobile()) { return $next($request);
} return response(['erorr' => 'Access denied'], 403);

}

MeisamSalehi avatar Apr 12 '19 14:04 MeisamSalehi

when i use in middleware $agent is null

MeisamSalehi avatar Apr 12 '19 15:04 MeisamSalehi

I do not know if you already solved your issue, but to those who are also experiencing malfunctioning, try to import the component in your code using use Jenssegers\Agent\Agent; instead of just use Agent;. This is a known problem, but I can't find the original issue.

Attivik avatar May 29 '19 08:05 Attivik

I do not know if you already solved your issue, but to those who are also experiencing malfunctioning, try to import the component in your code using use Jenssegers\Agent\Agent; instead of just use Agent;. This is a known problem, but I can't find the original issue.

not working still with this import

rainestech avatar Aug 28 '20 18:08 rainestech