Created
October 2, 2012 09:12
-
-
Save sineld/3817657 to your computer and use it in GitHub Desktop.
Laravel: Using form::select with <optgroup>
This file contains 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
<?php | |
//Source: http://forums.laravel.com/viewtopic.php?id=2807 | |
Route::get('optgroup', function() | |
{ | |
$eat_options = array( | |
'animals' => array( | |
'cats', | |
'dogs', | |
'monkeys', | |
), | |
'robots' => array( | |
'bender', | |
'johnny 5', | |
'metal gear', | |
), | |
); | |
echo Form::select( 'thing_to_eat', $eat_options, Input::old( 'thing_to_eat' )); | |
}); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Worked with Laravel 5.4