Skip to content

Commit

Permalink
Flush context
Browse files Browse the repository at this point in the history
  • Loading branch information
timacdonald committed Jan 29, 2024
1 parent caa152d commit 969b95b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Concerns/ProvidesDefaultConfigurationOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public static function prepareApplicationForNextOperation(): array
\Laravel\Octane\Listeners\FlushMonologState::class,
\Laravel\Octane\Listeners\FlushStrCache::class,
\Laravel\Octane\Listeners\FlushTranslatorCache::class,
\Laravel\Octane\Listeners\FlushContext::class,

// First-Party Packages...
\Laravel\Octane\Listeners\PrepareInertiaForNextOperation::class,
Expand Down
22 changes: 22 additions & 0 deletions src/Listeners/FlushContext.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace Laravel\Octane\Listeners;

use Illuminate\Log\Context\Repository;

class FlushContext
{
/**
* Handle the event.
*
* @param mixed $event
* @return void
*/
public function handle($event): void
{
if ($event->sandbox->resolved(Repository::class)) {

Check failure on line 17 in src/Listeners/FlushContext.php

View workflow job for this annotation

GitHub Actions / Static Analysis

Class Illuminate\Log\Context\Repository not found.
$event->sandbox->make(Repository::class)->flush()->setApplication($event->sandbox);

Check failure on line 18 in src/Listeners/FlushContext.php

View workflow job for this annotation

GitHub Actions / Static Analysis

Class Illuminate\Log\Context\Repository not found.
}
}
}

0 comments on commit 969b95b

Please sign in to comment.