Why request() helper return empty array?

87 Views Asked by At

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.

1

There are 1 best solutions below

0
Misagh Laghaei On BEST ANSWER

You can use url helpers:

url()->current();

or

url()->full();