I was able to achieve what I needed by creating my own validation rule instead, so that's a possible work around if anyone else is confused by this.
Add after() method to Spark's Registration Validation
I'm trying to set up custom validation for Registration in Spark, and I'm having some real issues figuring out if it is possible to create my own validator like in base laravel. I'm following the Spark docs which demonstrate that additional registration fields can be validated by adding the validateUsersWith() method to the SparkServiceProvider. That works great if you just want to add a new field to be validated, but I need to add a callback to check some more validation after the rules are checked. Normally you would do this with the after() method if you're creating the validation yourself, but I haven't had any luck getting my own validation to work with Spark.
Has anyone encountered this, and if so how did you set it up? When I try to use the custom validation with Spark's built in registration I get exceptions. I believe the Validation:Make() method is expecting the request to be a "Request" object, but the request that gets passed by Spark's registration is a "StripeRegisterRequest" object so it doesn't look like they're compatible anyway.
Can anyone explain to me how to add an after() callback using Spark's validation? Thank you!
Please or to participate in this conversation.