将网址重定向到laravel中的上一页 [英] Redirect url to previous page in laravel

查看:181
本文介绍了将网址重定向到laravel中的上一页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在laravel5.2中重定向到上一页,例如php中的URI Referrer.

How to redirect to previous page in laravel5.2 like URI Referrer in php.

我已经尝试过$ request-> url(); 但它获取当前网址.

I've tried $request->url(); but it gets the current url.

我有一个表单并列出页面.有很多列表可以重定向到表单.但是我想在提交后转到该特定页面.

I've a form and list pages.There are many lists that redirects to form.but I want to go to that specific page after submit.

对于Ex:有一个项目和客户"列表.如果我从项目中转到表单,则应该转到项目中,如果我从客户列表中转到表单,则提交表单后应该转到客户列表页面.

For Ex:There are a Project and Client list. If I go to form from project then it should go to project and if I go to form from client list It should go to client list page after submitting a form.

推荐答案

您应使用return redirect()->back();

这篇关于将网址重定向到laravel中的上一页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆