I have form in that a dropdown is containing country and state and on the basis of country id i'm filtering the states. But when I'm selecting country then country id is going into database but I want to insert selected country name into database please suggest something
Here is my View
<div class="form-group col-xs-5">
<label>State</label>
<select name="state" id="state" value="{{old('state')}}">
<option selected="" disabled="" value="">Choose One</option>
@foreach($states as $state)
<option value="{{$state->id}}">{{$state->name}}</option>
@endforeach
</select>
</div>
Here is code for controller code for state
$sell->state = $request->state;
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community