1 回答
TA贡献1820条经验 获得超10个赞
你可以使用像
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'));
} else {
$url = "https://wa.me/972" . request('inp') . "?text=" . str_replace(' ', '%20', request('txt')) . str_replace(' ', '%20', request('check'));
, 'success');
}
session()->flash('url', $url);
return redirect()->back();
}
在你的视图文件中
@if (session()->has('url'))
<script>
window.open('{{session()->get('url')}}', "_blank");
</script>
@endif
- 1 回答
- 0 关注
- 211 浏览
添加回答
举报