如何在 view 中获取上一个页面的值?

public function sendVerifiCode(VerificationCodeRequest $request, EasySms $easysms)
    {
    .
    .
    .
        //缓存验证码5分钟过期(->toDateTimeString())。
        \Cache::put($key, ['cellphone' => $cellphone, 'verification_code' => $code, 'verification_key' => $key], $expiredAt);

        $verifiArray = \Cache::get($key);

        return redirect()->route('verifiCodeInput', $key);
    }

    public function verifiCodeInput (){
        return  view('mobile.auth.member-login-verificationCode');
    }
1、`sendVerifiCode()` 执行以后,得到url `http://dn.com/verifinput?$key` 怎么在 `verifiCodeInput()` 获取 `$key` 的值?
2、怎么在url隐藏key值隐藏传值?
《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 Laravel 框架的设计哲学。
讨论数量: 2

存本地缓存或者session

4年前 评论
  1. rtrim($request->getQueryString(), '=')
  2. 在 sendVerifiCode 中 session('token', $key) ,在 verifiCodeInput 中 $key = session('token') 获取 $key 的值
4年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!