There isn't a very elegant way to do it.
You'll need to put a Blade if statement in there somewhere.
<option value="male" @if(old('gender') == 'male')selected@endif>male</option>
Unless you use LaravelCollective's HTML package.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
How to show old data of select element in Laravel?
Data can be shown in input like this:
<input id="name" name="name" class="form-control" type="text" value="{{ old('name', $user->name) }}">
when the element is select,how to show the old data?
<select class="form-control" name="gender">
<option value="male">male</option>
<option value="female">female</option>
</select>
There isn't a very elegant way to do it.
You'll need to put a Blade if statement in there somewhere.
<option value="male" @if(old('gender') == 'male')selected@endif>male</option>
Unless you use LaravelCollective's HTML package.
Please or to participate in this conversation.