php - 重定向到另一个页面时如何传递数据?
问题描述
我想在使用该数据重定向到另一个页面并在该页面中使用它时传递用户数据。
$mobile = (int) $request->mobile;
$user = User::where('mobile',$mobile)->first();
if ($user->count() > 0 && Hash::check($request->password, $user->password))
{
return redirect('/user_info')->with('user',$user);
}
我想在其中使用用户数据的视图:
<div class="row">
<h3>Valnteer: {{ $user->name }}</h3>
</div>
我得到的问题是:
未定义变量:用户
解决方案
推荐阅读
- docker - Docker、Traefik 2.2 和默认证书
- plot - 在任何网站都找不到答案
- java - JavaFX 将 mp3 文件导入 ListView
- php - 向电话号码添加自定义掩码
- loopback - 如何在 Loopback 4 中实现事务
- google-sheets-api - 使用 Google 表格 V4 克隆 Google 电子表格并授予队友访问权限
- libvlc - 无法让 LibVlcSharp UWP 示例与本地媒体一起使用
- node.js - 绑定类型“signalR”未注册
- python - 如何从 HTML 用户输入中获取数据到 python 文件
- youtube-api - 如何增加每个用户对 Youtube Data API 的最大请求数