what is not working? looks ok despite hardcoding the admin in that method.
you can also put in an email directly to the CC.
you might want to think about queing for performance reasons.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi, I need to send an email to more than one user (admin and the user who created the model) every time a specific model is created. To do this, I created this function inside the model:
public function sendMail( User $user)
{
$admin = new User;
$admin ->email = '[email protected]';
\Mail::to($user)->cc($admin)->send(new Welcome($user));
flash('Email sent.','success');
}
Am I doing something wrong? Thanks
Please or to participate in this conversation.