Laravel's tap() helper

Submitted by phpScots - 2 months ago

Laravel's tap() is global helper function , that is used for improving the Laravel framework’s declarative capabilities.Tap() function is inspired from Ruby.Tap() simply takes $value and a $callback / anonymous function. The $callback will execute with the $value as the argument. And finally the $value will be returned.You can make changes in value in callback.

Read more from http://www.laravelinterviewquestions.com/2017/05/laravel-tap-helper.html

Ads cover the costs of maintaining Laravel-tricks

comments powered by Disqus

Ads cover the costs of maintaining Laravel-tricks