search

Home  >  Q&A  >  body text

How to reset the request object in laravel

Reset or destroy
In an ajax request, calling another method is always affected by the current request

As shown above, these parameters should be removed in the next method

大家讲道理大家讲道理2809 days ago345

reply all(2)I'll reply

  • PHPz

    PHPz2017-05-16 16:52:10

    Your $request 是从服务容器里取出来的吧?那你可以直接使用 ContainerforgetInstancesetInstance 方法来重新绑定 Request instance to the container, please refer to: Laravel API

    for details

    As for how to create the Request 对象,可以使用 IlluminateHttpRequest::capture() method.

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-05-16 16:52:10

    Can you be more specific about the question? It would be better if you put some code.

    reply
    0
  • Cancelreply