I want to use request information at report() function in Error Handler, but can't get it.
public function report(Exception $exception)
{
$request = request();
// -> empty array
parent::report($exception);
}
Why request() helper return empty array? Thanks.
You can use url helpers:
url()->current();
or
url()->full();
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.