Obtenha valor de coluna única em Laravel Eloquent
Vehicle::find(3)->value('register_number');
Lucky Lark
Vehicle::find(3)->value('register_number');
$items = DB::table('items')
->select('id', 'ref_code', 'name', 'price')
->where('ref_code','=', $request->ref_code)
->first();
// let's assume user_id is 5
DB::table('attendances')
->where('date_only', '=', $newdate)
->orderBy('logon','asc')
->pluck('user_id'); // "5"
ModelName::find(id)->value('column_name');