Last active
August 29, 2015 14:03
-
-
Save sabid/7f33c55fc814e96d87cb to your computer and use it in GitHub Desktop.
Laravel Form::select() Populate fron data base
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Controller Create | |
$ciudades_opciones = \Ciudad::orderBy('nombre', 'asc')->lists('nombre','id'); | |
View of create | |
{{ Form::select('ciudad_id', array('default' => 'Seleccione') + $ciudades_opciones, null, array('class' => 'form-control select2me')) }} | |
Note: the null options is the default value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment