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

bigblueboss's avatar

Which controller handles registration in Spark?

Laravel 5.3 uses RegisterController to make a new user row. But it seems to me Spark isn't. I want to add more detail into the row being created. How can I do this in spark? I'm looking for the controller where I can go to for the edits.

I wrote in an extra detail into RegisterController:

protected function create(array $data)
{
  return User::create([
      'name' => $data['name'],
      'email' => $data['email'],
      'password' => bcrypt($data['password']),
      'verified' => 1
  ]);
}

The 'verified' => 1 is written in by myself, and it's not being accounted for at the moment. I added verified to fillable for User model as well.

Thanks kindly!

0 likes
6 replies
Kemito's avatar

It did not made changes probably because you forgot to add that field in list of fillable fields at your model.

protected $fillable =

at User model

bigblueboss's avatar

@Kemito Thanks for the reply. I did include it like this:

protected $fillable = [
    'name',
    'email',
    'verified',
];

Do you think it could be something else?

Kemito's avatar

You can always check with dumping out $data in that method which will allow you to see even if it hits that place. If no - issue is somewhere else. Maybe validation failed somehow - to check that you can dump out the error bag in top of your view and see what is going on. From that you will probably find what is wrong.

bigblueboss's avatar

@Kemito Thanks for the advice again.

It's not hitting it for sure. When I deleted the whole function, it was still registering fine. Dumping data isn't being executed as well.

I know this is something about Spark and I'm trying to find out now which controller in spark it is going to.

bigblueboss's avatar

I found another User class in spark\install-stubs\app\User.php

The fillable for here was also update to include 'verified' but this still didn't help.

bigblueboss's avatar

Does anyone know which controller spark has its registration go to? I thought it would be the RegisterController (like Laravel), but it's clear to me that the create() function isn't even being reached (When I delete the create function, and then sign up, the row still goes through).

Please or to participate in this conversation.