在我的方法中,我具有以下路线声明
return redirect('home')->with('success', 'Request is send!');
现在,我想在我的ajax成功函数中使用它。目前,我正在使用它,并且可以正确地重定向到“ home”,但是我的成功消息未运行。
$.ajax({
headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')},
type: 'post',
url: '/home/grouprequest',
data: {'groupid': groupid},
success: function (result) {
window.location.replace('/home'->with('success', 'Request is send!'));
}
我必须更改什么?