Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mobody's avatar

Add fields to validator in UpdateContactInformation

Do you know how i can override the validator() and handle() method for updating the contact information form in the settings tab?

namespace Laravel\Spark\Interactions\Settings\Profile;

class UpdateContactInformation implements Contract
{
    /**
     * {@inheritdoc}
     */
    public function validator($user, array $data)
    {
        return Validator::make($data, [
            'name' => 'required|max:255',
            'email' => 'required|email|unique:users,email,'.$user->id,
        ]);
    }

Is there perhaps something like the Spark::createUsersWith() method like in SparkServiceProvider? If not, what would be the best way to handle this?

0 likes
2 replies
EventFellows's avatar
Level 16

For some of the core methods there is a Spark::swap() available to overwrite it but not sure if this one is covered.

Please or to participate in this conversation.