Which scaffolding did you use?
In Breeze for example you can call the class and method in the RegisteredUserController. Work out similar if fortify or manual.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
How do I run a query builder after registrating (and not logging in)?
Like that, it works:
protected function create(array $data)
{
$user = User::create([
'name' => $data['name'],
'email' => $data['email'],
'password' => Hash::make($data['password']),
]);
DB::table('friends')->insert([
'from_user_id' => 1,
'to_user_id' => $user->id,
'accepted' => 1
]);
return($user);
}
Please or to participate in this conversation.