你好,全球开发人员,请问我需要 laravel 控制器的帮助,我有一个函数可以为 whatsapp msg 生成一个链接,我想在不关闭当前页面的情况下在新选项卡中打开这个链接,请在下面是我的函数代码
public function whatsapp(Request $request)
{
$whatsapp_log = new WhatsappLog();
$whatsapp_log->telephone = request('tele') ?? request('inp');
$whatsapp_log->calling_no = request('inp');
$whatsapp_log->text = request('check') ? request('check') . '>' . request('txt') : request('txt');
$whatsapp_log->log_by = auth()->user()->name;
$whatsapp_log->save();
$mail = mail::where('id', '=', request()->get('id'))->first();
$mail->status = 0;
$mail->updated_by = auth()->user()->name;
$mail->save();
event(new MailDoneEvent($mail));
if (request('inp') == 'custom') {
$url = "https://wa.me/972" . request('tele') . "?text=" . str_replace(' ', '%20', request('txt')) . str_replace(' ', '%20', request('check'));
return Redirect::away($url);
} else {
$url = "https://wa.me/972" . request('inp') . "?text=" . str_replace(' ', '%20', request('txt')) . str_replace(' ', '%20', request('check'));
, 'success');
return Redirect::away($url);
}
return redirect()->back();
}
拉莫斯之舞