laravel/framework — pull request #1544 by driesvints (2013-06-05 21:29:50+00:00)
Title: Add implode method to Collection class and Query Builder

By re-using the `lists` function on various classes we can add some other useful functionality. I've added an `implode` function to the Collection class and the Query Builder class. This makes it easy to concatentate values.

Instead of having to do this:

$values = $collection->lists('title');

echo implode(',', $values); // taylor,dayle

You just can do this:

echo $collection->implode('title', ','); // taylor,dayle

Or just paste them together by omitting the delimiter:

echo $collection->implode('title'); // taylordayle

## Use Cases

### Tags

Use it to lists tag titles quickly:

echo $tags->implode('title', ',');

### List values

Create a quick html list of values.

echo '

' . $collection->implode('title', '
') . '

';