How to get names in list instead of associated array ( id as key and name as value )

PiggyBankCategory::orderBy( 'name', 'asc' )->get()->pluck('name', 'id'); 

Related Posts


Using WhereIn

Updating multiple rows

Using Like

Using orWhere

What is Query Builder?

Using "with" in eloquent query

Getting last inserted id

Selecting last row of a table

Using parameters in find() method

Using local scope in eloquent

Using global scope in eloquent