Support the ongoing development of Laravel.io →
Views Blade Forms

Please, how do I when editing a car, list all the brands, however already come selected the brand that has been registered previously.

VIEW -> http://laravel.io/bin/PXOX1 CONTROLLER -> http://laravel.io/bin/42Y29

Last updated 3 years ago.
0

May be this will help:

            {!! Form::label('marca_id', 'Marca do Carro:') !!}
            {!! Form::select('marca_id', $nome, $carro->marca_id, ['class'=>'form-control']) !!}

The thrid parameter of Form::select() is for the current value.

0
<option value="{{ $marca->id }}" @if($carro->marca_id==$marca->id) selected="selected" @endif>{{ $marca->marca }}</option>
Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

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.