Use something like this; This will get a list of all the subjects within the Topics Model.
Topics::select(\DB::raw('DISTINCT `subject`'))->get()
It works, thank you very much. But it creates a very odd mess in my form. I pick up the data the way you suggested and put into form like this:
{{ Form::select('domain', $domains) }}
It does print only single domain from the list but in the following format:
{"domain":"google.com"}
instead of just listing domain name.
I must be missing something in the way I'm creating my form.
Try this within your form;
$domains->lists('domain')
To get both the value of the drop list to be the domain and the visual drop box selection to be the same do this;
$domains->lists('domain','domain')
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community