Laravel - Error Handling - Ignoring Exceptions By Type
When building your application, there will be some types of exceptions you simply want to ignore and never report. Your application's exception handler contains a
$dontReport property which is initialized to an empty array. Any classes that you add to this property will never be reported; however, they may still have custom rendering logic:
use App\Exceptions\InvalidOrderException; /** * A list of the exception types that should not be reported. * * @var array */ protected $dontReport = [ InvalidOrderException::class, ];
Behind the scenes, Laravel already ignores some types of errors for you, such as exceptions resulting from 404 HTTP "not found" errors or 419 HTTP responses generated by invalid CSRF tokens.