Support the ongoing development of Laravel.io →
Validation Installation Configuration

Hi I am using custom request class that extends laravel Request class validate user input data. I override response function to return error message as JSON string like this

public function response(array $errors){
    return ['success' => 0, 'messages' => $errors];
}

but I am getting this error: ErrorException in VerifyCsrfToken.php line 136: Trying to get property of non-object

what is the reason of this error? thanks for your help

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.