Skip to content

Commit

Permalink
Add pingBeforeIf
Browse files Browse the repository at this point in the history
  • Loading branch information
ThunderBirdsX3 committed May 2, 2018
1 parent 49a7592 commit 07e1c5e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Illuminate/Console/Scheduling/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,22 @@ public function pingBefore($url)
});
}

/**
* Register a callback to ping a given URL before the job runs if condition is true.
*
* @param bool $condition
* @param string $url
* @return $this
*/
public function pingBeforeIf(bool $condition, string $url)
{
if ($condition) {
return $this->pingBefore($url);
}

return $this;
}

/**
* Register a callback to ping a given URL after the job runs.
*
Expand Down

0 comments on commit 07e1c5e

Please sign in to comment.