Reputation: 167
I have one database query which returns collection, i want to fetch the value instead of fetching collection
or array
, please help me to achieve this thing
$type=DB::table('users')->where('id',$value)->pluck('role')->toArray();
Actual Result : ['admin'] //array
Expected Result : $type='admin'
Upvotes: 0
Views: 456