I have such a simplified version of a class
class Handler extends ExceptionHandler
{
protected $dontReport = [];
public function report(Exception $exception)
{
$environment = \App::environment();
//...
}
//...
}
And I receive PHP Fatal error: Uncaught Error: Class 'App' not found in .../app/Exceptions/Handler.php:37
.
In other places of the app it works.
In config/app.php
it was registered.
'aliases' => [
'App' => Illuminate\Support\Facades\App::class,
//...
]