N
N
Nik Gubin2016-09-25 03:17:49
Laravel
Nik Gubin, 2016-09-25 03:17:49

How to manually set the value of an empty field during Request::flash() in Laravel?

Good night, comrades. The crux of the issue is in the title. Who will tell?
There is a form, title and alias. If the alias is not specified, then it is formed from the header. But if an error occurs in a field with an alias (for example, the generated alias from the header is already taken and you need to say about it), only the header is in Request::old, and this is reasonable, because we did not send the alias, or rather sent it empty. So the question is, how can I do so that I can expand the output of old ()? And is it real?
Thanks to!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Victor, 2016-09-25
@v_decadence

The withInput method of the RedirectResponse class accepts an array, where you can pass a combined array of all input fields + the value you need.
Or via Session::flash, but then when outputting the input, you will need to manually check for the presence of this value in the session.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question