Support the ongoing development of Laravel.io →
Views Blade Forms
Last updated 2 years ago.
0
$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) }}
Last updated 2 years ago.
0

wow thank you bro. it works. thank you very much. i tried a full day for this result.

Last updated 2 years ago.
0

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));
		
	
		}
Last updated 8 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.