Laravel 更多时间使用令牌

Laravel more time using token

我想知道如何删除表单 POST 方法中的令牌,因为当我需要 10 到 15 分钟填写表单并发送表单时,我收到令牌异常并且我丢失了我所有的数据。

感谢您的帮助

我不建议删除令牌。而是增加到期时间或在 post 之后用输入值重定向回来。

public function render($request, Exception $e)
{
    if ($e instanceof \Illuminate\Session\TokenMismatchException) {
         return redirect()->back()->withInput()->with('token', csrf_token());
    }

    return parent::render($request, $e);
}