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

Not entirely sure if you can do that with the built-in email validation rule. A simple dirty way would be to do a simple if-check and skip email validation if the input email is one of your selected emails.

0

true, this could be a neat and simple solution. But how do I implement that solution while using form-request-validation?

0

I would guess you have to extend the validator and create a custom unique rule that accepts exceptions in string format. Read up on extending the validator and check out the validateUnique method in this file: https://github.com/laravel/framework/blob/5.0/src/Illuminate/Validation/Validator.php

You can use that as a base for your extension and just add what you need.

0

If you need just a couple objects (users) it's easier to create them manually in php artisan tinker console, than to write a custom validator with an exception.

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.