Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.8] added Tappable trait documentation #5257

Merged
merged 1 commit into from
Jun 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -1658,6 +1658,8 @@ If no Closure is passed to the `tap` function, you may call any method on the gi
'email' => $email,
]);

If you prefer to call the `tap` function on an instance over calling the global helper, you can add it to your own classes by using the `\Illuminate\Support\Traits\Tappable` trait. The `tap` function of this trait only takes one argument: a Closure. The instance itself will be passed to this Closure and then be returned by the `tap` function.

<a name="method-throw-if"></a>
#### `throw_if()` {#collection-method}

Expand Down