1

I have minimally changed the registration process - instead of name, I'm using firstname and lastname. No problem.

form: $.extend(true, new SparkForm({ 
    firstname: '', 
    lastname: '', email: '' }), 
    Spark.forms.updateContactInformation)

That works fine for CREATION of the user object, however upon successful registration, I want the user to fill in the rest of their profile - of which there are many new fields I'm adding.

So, in adding all the new fields to the settings page (for example, lastname), on clicking the update button, it seems something is still validating the name, instead of firstname, and I'm unsure where to put in my new fields for validation purposes. Getting error The name field is required.

As per the docs, I'm using Spark::validateUsersWith to validate the firstname instead of name, hence the create user works - but where is the validation for updating ? I cant seem to locate that.

I can see its using ContactInformationController@update and confirm its being hit with some logging, however even trying explicitly

$this->validate($request, [
        'lastname' => 'nullable|max:255',
    ]);

in there doesn't do the trick - must be something in here but not sure how it works:

$this->interaction(
        $request, UpdateContactInformation::class,
        [$request->user(), $request->all()]
    );
yoyoma
  • 3,336
  • 6
  • 27
  • 42

0 Answers0