Answer the question
In order to leave comments, you need to log in
How to set condition for input value in laravel 5.2?
For example, I am writing a form that I want to use to add a new article and to edit an existing one.
For the new one, everything is clear, the default value can be set to NULL, but if I use it for editing, then I need the default inputs to contain values from the database for a specific article. I can write a value specifically for this page, but then the form does not work if I create a new article, because it tries to find the value that I set by default and does not find it (and it is not needed). How to make the input values for a new article be NULL, and for editing they are pulled out of the database?
<div class="form-group">
{!! Form::label('email', 'E-mail:') !!}
{!! Form::email('email', $message->email, ['class' => 'form-control', 'placeholder' => 'Ваш email']) !!}
</div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question