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

bigblueboss's avatar

Spark - Customizing User Registration

If I want to have an extra field in laravel, normally, I'd simply add in the field and take care of it in the controller.

In laravel spark, however, I don't understand where the logic goes.

Would I need to change it within the RegisterController?

protected function create(array $data)
{
    $user =  User::create([
        'name' => $data['name'],
        'email' => $data['email'],
        'password' => Hash::make($data['password']),
    // ADD IN MY OWN CODE HERE.
    ]);

    Mail::to($user->email)->send(new NewUser($user));

    return $user;
}
0 likes
1 reply

Please or to participate in this conversation.