Documentation for dropdown is provided @ http://laravel.com/docs/4.2/html#drop-down-lists
You are already passing the data to the view. In your view/blade file, you can do something like this
Form::select('name', $Dropdown );
The problem with this is that, the select parameter expects a string. What i'll be passing on to it as per your suggestion will be an object.
Nope. Select statement accepts array as second argument. Since query builder returns the value as object, you have to remap to array before passing it select.
$filter = DB::select(DB::raw('SELECT DISTINCT filter AS filt FROM filter.database'));
foreach ($filter as $key => $value) {
$dropdown[$key] = $value->filt;
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community