海蘭大家好,我有過這樣的兩個字段,後來我需要重複這些領域,所以我這樣做,用JavaScript這樣數據存儲到數據庫
<div class="col-md-9">
<div class="form-group">
{{Form::label('_customer_name', 'Customer Name :', ['class' => 'contc p-4 icn']) }}
{{Form::email('_customer_name', null, ['class' => 'form-control chos_bsns', 'id' => '_customer_name', 'placeholder' => 'eMail here ']) }}
</div>
</div>
<div class="col-md-12">
<div class="form-group">
{{sprintf(Form::label('_feedback', '%s',['class' => 'compny_over icn']),'Feedback recieved from customer <small>(Maximum 100 words)</small>
<span> Word Count : 6 </span>') }}
{{Form::textarea('_Feedback', null, ['class' => 'form-control', 'id' => '_feedback', 'placeholder' => 'Information regarding service' , 'rows' => '5']) }}
</div>
</div>
,我正在提交像這樣在數據庫中的值更早
[
'name'=>Input::get('_customer_name'),
'feedback'=>Input::get('_Feedback'),
'website_id'=>Input::get('website_id')
];
Testimonial::create($data);
但因爲我重複了一遍我不知道那些存儲在數據庫中的任何想法將是多大的幫助。
你是說,你有2種形式,存儲同樣的事情? – Rai