I need to populate a blade format tag.
I\'m aware of the Model::pluck(\'column1\', \'column2\')
method to populate a select tag.
Just so people who come here know, the pluck method returns an object, and if you want to pluck multiple columns and return an array at the same time without using the toArray
method, you could just pass the names of the column to the all()
function, and it will return the wanted columns as an array.
YourModelName::all('id', 'name');