$category_list = CategoryModel::lists('id', 'name')
Where 'name' is whatever you want to display as the label. Then, in your form:
{{ Form::select('parent_category', array('' => 'Select Category', '0 ' => 'Main Category') + $category_list) }}
wow thank you bro. it works. thank you very much. i tried a full day for this result.
Dowloads.blade.php
{{ Form::open(array('url' => '/downloads', 'method' => 'post')) }}
{{ Form::select('downloads', $download_options, Input::old('platform'), array('id'=> 'filter')) }}
{{ Form::submit('Obtain results') }}
{{ Form::close() }}
DownloadController.php
public function index()
{
$download_option = DB::table('downloads')
->distinct('platform')
->groupBy('platform')
->lists('platform', 'id');
return View::make('/downloads', array('download_options' => $download_option));
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community