Using the old() helper
Populate a form with user's previous entry, or default data
<select name="contact">
@foreach($contacts as $contact)
<option value="{{$contact->id}}">{{ $contact->name }}</option>
@endforeach
</select>Selecting the previous value
<select name="contact">
@foreach($contacts as $contact)
<option value="{{$contact->id}}"
{{ $contact->id == $order->contact_id ? 'selected' : ''}}>
{{ $contact->name }}
</option>
@endforeach
</select>PreviousUsing Spatie Valuestore to hold frequently accessed settingsNextAlternatives to using Eloquent Accessor
Last updated