Skip to content

Commit

Permalink
Fix examples for exceptions (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
stasadev committed Jul 2, 2023
1 parent 26f2f6a commit faefdfc
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,22 @@ public function register(): void
});
}

// In Laravel 5.7.x, 5.8.x, 6.x, 7.x
// In Laravel 7.x
// app/Exceptions/Handler.php
public function report(Throwable $exception)
{
if ($this->shouldReport($exception) {
if ($this->shouldReport($exception)) {
\Stasadev\SlackNotifier\Facades\SlackNotifier::send($exception);
}

parent::report($exception);
}

// In Laravel 5.7.x, 5.8.x, 6.x
// app/Exceptions/Handler.php
public function report(Exception $exception)
{
if ($this->shouldReport($exception)) {
\Stasadev\SlackNotifier\Facades\SlackNotifier::send($exception);
}

Expand Down

0 comments on commit faefdfc

Please sign in to comment.