Laravel pluck fields from relations

You can use Laravel’s pluck method as:

$sellers = Seller::with('user')->get()->pluck('user.first_name', 'id')

Leave a Comment