Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Commit

Permalink
Check if class exists
Browse files Browse the repository at this point in the history
  • Loading branch information
barryvdh committed Apr 28, 2020
1 parent c843520 commit 1d127db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/HandleCors.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function handle($request, Closure $next)
}

// Add the headers on the Request Handled event as fallback in case of exceptions
if ($this->container->bound('events')) {
if (class_exists(RequestHandled::class) && $this->container->bound('events')) {
$this->container->make('events')->listen(RequestHandled::class, function (RequestHandled $event) {
$this->addHeaders($event->request, $event->response);
});
Expand Down

0 comments on commit 1d127db

Please sign in to comment.