$posts->map(function ($post) {
$post['url'] = 'http://your.url/here';
return $post;
});
or (if its Error "Cannot use object of type stdClass as array")
$posts->map(function ($post) {
$post->url = 'http://your.url/here';
return $post;
});
source : https://laracasts.com/discuss/channels/laravel/how-to-add-a-new-element-to-every-item-of-collection