Skip to content

Commit

Permalink
Add thenPingIf
Browse files Browse the repository at this point in the history
Add `thenPingIf`
  • Loading branch information
ThunderBirdsX3 committed May 2, 2018
1 parent ab02a65 commit 49a7592
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 @@ -471,6 +471,22 @@ public function thenPing($url)
});
}

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

return $this;
}

/**
* State that the command should run in background.
*
Expand Down

0 comments on commit 49a7592

Please sign in to comment.