Support the ongoing development of Laravel.io →
Database Eloquent Forms

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;
Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

techiva techiva Joined 9 Jan 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.