-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from stayallive/octane
Listen to more Octane events
- Loading branch information
Showing
6 changed files
with
52 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
namespace Stayallive\Laravel\Passport\Memoized; | ||
|
||
interface MemoizedRepository | ||
{ | ||
public function clearInternalCache(): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace Stayallive\Laravel\Passport\Memoized; | ||
|
||
use Laravel\Passport\TokenRepository; | ||
use Laravel\Passport\ClientRepository; | ||
use Laravel\Octane\Contracts\OperationTerminated; | ||
|
||
class OctaneOperationTerminatedListener | ||
{ | ||
public function handle(OperationTerminated $event): void | ||
{ | ||
$repositories = [ | ||
$event->app()->make(TokenRepository::class), | ||
$event->app()->make(ClientRepository::class), | ||
]; | ||
|
||
foreach ($repositories as $repository) { | ||
if ($repository instanceof MemoizedRepository) { | ||
$repository->clearInternalCache(); | ||
} | ||
} | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters