Я хочу отправить Dynami c письмо после регистрации в laravel. мои коды:
$gift = new Gift();
$gift->user_id = Auth::id();
$gift->register_user = $request->input('email');
$gift->status = 0;
$gift->amount = 10;
$gift->code = uniqid('coinex-');
if ($gift->save()) {
$data = array('code'=>$gift->code,'friend'=>Auth::user()->name,'email'=> $gift->register_user);
$email = $gift->register_user;
Mail::send('invite', $data, function($message) {
$message->to("Receiver_Email_address", Auth::user()->name.' Invited you to Join site')->subject
(Auth::user()->name.' Invited you to Join Coinex Plus');
$message->from('info@site.com','site');
});
toast('Thank you for your cooperation !', 'success');
return redirect()->back();
} else {
toast('something wrong please try again !', 'danger');
return redirect()->back();
}
как я могу заменить Receiver_Email_address на $ email ?