I'm having a problem where i'm trying to queue a message to send to the registered user, when i am running everything works, but the queue just wont work, can someone help me with this please? Here's the registration controller
protected function create(array $data)
{
$user = User::create([
'name' => $data['name'],
'email' => $data['email'],
'password' => Hash::make($data['password']),
'type' => $data['type'],
]);
$email = (string)$data['email'];
$job = (new SendEmailJob($email))->delay(Carbon::now()->addSeconds(5));
dispatch($job);
return $user;
}
I have checked if i can send email and it works i can send email but when i am pointing to a specific email rather to the data which came from the register form. Here's the SendEmailJob
public function handle($user)
{
Mail::to($user)->send(new SendEmailMailable());
}