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

I'm populating a select with the result of a query like this:

on controller

$departaments = \App\Departament::All()->sortBy('name')->lists('name','id');

on view

<div class="form-group">
    {!! Form::select('departament', $departaments, null, ['class'=>'form-control']) !!}
</div>

but must later add a blank row to select.

How do I do that?

Last updated 3 years ago.
0

Sign in to participate in this thread!

PHPverse

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.