Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamic select list in Laravel with Form base bundle

Tags:

php

laravel

Hi all i've been search for a while and can't find it in their documentation. does anyone know how to build a dynamic select list in laravel using the form-base plugin?

Thanks

like image 928
user1740151 Avatar asked Feb 18 '23 10:02

user1740151


1 Answers

public function user_options()
{
    return array('' => 'Choose a User') + User::lists('id', 'name');
}


{{ Form::select('user_id', UserWhateverForm::user_options(), UserWhateverForm::old('user_id')) }}
like image 165
Shawn McCool Avatar answered Feb 20 '23 23:02

Shawn McCool