Skip to content
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
32 changes: 32 additions & 0 deletions src/Illuminate/Foundation/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,38 @@ function report($exception)
}
}

if (! function_exists('report_if')) {
/**
* Report an exception if the given condition is true.
*
* @param bool $boolean
* @param \Throwable|string $exception
* @return void
*/
function report_if($boolean, $exception)
{
if ($boolean) {
report($exception);
}
}
}

if (! function_exists('report_unless')) {
/**
* Report an exception unless the given condition is true.
*
* @param bool $boolean
* @param \Throwable|string $exception
* @return void
*/
function report_unless($boolean, $exception)
{
if (! $boolean) {
report($exception);
}
}
}

if (! function_exists('request')) {
/**
* Get an instance of the current request or an input item from the request.
Expand Down