Laravel change input value

后端 未结 6 1620
灰色年华
灰色年华 2020-12-01 05:45

In laravel, we can get the input value via Input::get(\'inputname\'). I try to change the value by doing this Input::get(\'inputname\') = \"new value\";

6条回答
  •  庸人自扰
    2020-12-01 06:24

    You can use Input::merge() to replace single items.

    Input::merge(['inputname' => 'new value']);
    

    Or use Input::replace() to replace the entire input array.

    Input::replace(['inputname' => 'new value']);
    

    Here's a link to the documentation

提交回复
热议问题