1
Hello, I’m having trouble entering data from controller.
I am doing the activities of a Code House Laravel book to learn and needed to do this to update the record of a bank tuple, I ended up using the following workaround:
<input name="nome" class="form-control" value="{{$p->nome}}" />
It worked, however, in the book, the author teaches to keep the data in the form during a validation error using the following code:
<input name="nome" class="form-control" value="{{ old('nome') }}" />
This broke my scheme of assigning direct in value the attributes of the object coming from the database... Thus, I will have to add the values in the form inputs via controller during the data update.
I searched in several places, I even found some reference, but I could not use them due to the lack of namespace that should import.
From now on, thank you.
Thanks! I didn’t know this isset($var) method. I’m new to PHP, rs.
– HDeiro