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

Commit

Permalink
Reconfigures app terminating as closure internally, fixes #59
Browse files Browse the repository at this point in the history
  • Loading branch information
aschmelyun committed Jan 23, 2020
1 parent 580f836 commit b796690
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions src/Actions/SaveRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,20 @@ public function __construct(Request $request, RouteMatched $route = null)

public function dispatch()
{
app()->terminating($this->dispatchAfterTerminating());
}

public function dispatchAfterTerminating()
{
if(!$this->shouldRequestBeStored()) {
return false;
}
app()->terminating(function() {
if(!$this->shouldRequestBeStored()) {
return false;
}

$this->checkExpiredLogs();
$this->checkExpiredLogs();

$createdRoute = $this->createRoute();
if($createdRoute) {
$this->triggerNotifications($createdRoute);
}
$createdRoute = $this->createRoute();
if($createdRoute) {
$this->triggerNotifications($createdRoute);
}

return true;
return true;
});
}

public function shouldRequestBeStored()
Expand Down

0 comments on commit b796690

Please sign in to comment.