Laravel's tap helper function explained
A little known helper function, called tap was added to Laravel 5.3. In this short post I'll explain how this function can be used. Let's first take a look at the tap function itself. It's actually a very short one. function tap($value, $callback) { $callback($value); return $value; } So you give it…