简体   繁体   English

通过Laravel中的会话传递请求

[英]Passing request through sessions in laravel

From my last question where I have't got answer I went deep down into the problem and found out what it is: 从我最后一个没有答案的问题开始 ,我深入探究了这个问题,并找出了问题所在:

session()->flash('data', request());

I thought this would work because I used it before in little different way: 我认为这会行得通,因为我以前以略有不同的方式使用过它:

session()->flash('data', request()->input('fullname'));

But when i submit that form from last question I had more than just registering the user, but first part was to register the user and redirect to page where the user is logged in and pass other form values. 但是,当我从上一个问题提交该表单时,我不仅拥有注册用户的权利,而且第一步是注册用户并重定向到用户登录的页面并传递其他表单值。 It could work if I pass them as text one by one, but is there a way to pass whole request object? 如果将它们作为文本一一传递,可能会起作用,但是有没有办法传递整个请求对象?

我只是通过添加request()->all()request(['those','that','are','needed'])

Use request()->all() to return the data. 使用request()->all()返回数据。 If you just use request() it's just returning the Request class. 如果您只使用request()那么它只是返回Request类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM