Answer the question
In order to leave comments, you need to log in
Loading values into laravel form fields?
Good afternoon. I ran into this problem, maybe someone can help me to solve it.
I have a form with 3 fields
<input type="text" name="title" id="title">
<input type="text" name="desc" id="desc">
<select name="type" id="select_type">
<option value="1">Type 1</option>
<option value="2">Type 2</option>
</select>
public function create()
{
$quote_types = \App\QuoteType::get()->pluck('title', 'id')->prepend(trans('global.app_please_select'), '');
$quote_section = \App\QuoteSectionType::get()->pluck('title', 'id')->prepend(trans('global.app_please_select'), '');
$attchments = \App\QuoteAttachment::get()->pluck('title', 'id');
$created_bies = \App\User::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');
return view('admin.quotes.create', compact('quote_types', 'attchments', 'created_bies', 'quote_section'));
}
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