Laravel – Dropdowns with Collection’s Lists method

The Collection class in Laravel is really awesome. In Laravel, Eloquent returns result in the collection object. The class contains a lot of handy methods that will make your work so much easier. In this post I would like to write about List() method and I show you , how I used list method to generate HTML dropdown with laravel form collective .

list() method will return every value of a given key. The following example returns every category’s title, indexed by their category id.

Generating A Drop-Down List

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.

0 0 vote
Article Rating
Notify of
Inline Feedbacks
View all comments Protection Status
Would love your thoughts, please comment.x