$result = MyModel::with('users:email')->get()->map(function ($item) {
$item['users'] = $item['users'][0]['email'];
return $item;
});
array:1 [▼
0 => array:5 [▼
"id" => 1
"user_id" => "222"
"mymodel" => "success"
"created_at" => "2023-07-26T15:48:44.000000Z"
"updated_at" => "2023-07-26T15:48:44.000000Z"
"users" => "e@test.com"
]
]