Support the ongoing development of Laravel.io →
posted 10 years ago
Validation
Last updated 2 years ago.
0

in short:

in Controller:

$errors = $this->userValidation->errors()

in UserValidation:

if$validatior->fails) $this->errors = $val->errors

function errors() { return $this->errors; }

Last updated 2 years ago.
0

Didn't work. Also many syntax errors.

Last updated 2 years ago.
0

Throw an exception and catch it in the controller?

Last updated 2 years ago.
0

Not sure how to do that. I also need to refill the form and show the error messages. Can you show me some code?

Thanks

Last updated 2 years ago.
0

behnampmdg3 said:

Didn't work. Also many syntax errors.

OMG. This is not copy & paste code ;) It's solution HOW to do this.

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.

© 2024 Laravel.io - All rights reserved.