How to concatenate value in a dropdownlist in laravel 5?

1

How to add the first default value in a dropdownlist? I tried to do this:

{!! Form::select('Usuario.est_id',array('null' => 'Selecione') + $estados, null, ['class' => 'form-control']) !!}

but I get the error: FatalErrorException in 30aae33d562adffd11ade38d9100e329 line 26: Unsupported operand types

The $ states are a collection.

    
asked by anonymous 21.07.2015 / 23:53

1 answer

2

Do so

{!! Form::select('Usuario.est_id',array_merge(['null' => 'Selecione'],
       Estado::orderBy('uf')->lists('uf', 'est_id')), null, ['class' => 'form-control']) !!}
    
22.07.2015 / 00:11