1$items = DB::table('items')
2 ->select('id', 'ref_code', 'name', 'price')
3 ->where('ref_code','=', $request->ref_code)
4 ->first();
5
1$collection = collect([
2 ['product_id' => 'prod-100', 'name' => 'Desk'],
3 ['product_id' => 'prod-200', 'name' => 'Chair'],
4]);
5
6$plucked = $collection->pluck('name');
7
8$plucked->all();
9
10// ['Desk', 'Chair']