使用Ajax中的语句重定向路由

时间:2018-07-18 12:15:15

标签: ajax laravel routes

在我的方法中,我具有以下路线声明

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!')); 
                    }

我必须更改什么?

0 个答案:

没有答案