Skip to content

Commit 0d0075b

Browse files
Use scoped instances of instead of singletons
See https://laravel.com/docs/8.x/container#binding-scoped. These are essentially the same thing as `singleton` instances, only difference being that Laravel will make sure that the `scoped` instances get refreshed every request (in Octane) and every job (Horizon).
1 parent e91e5e2 commit 0d0075b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ActivitylogServiceProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ public function registeringPackage()
2929
{
3030
$this->app->bind(ActivityLogger::class);
3131

32-
$this->app->singleton(LogBatch::class);
32+
$this->app->scoped(LogBatch::class);
3333

34-
$this->app->singleton(CauserResolver::class);
34+
$this->app->scoped(CauserResolver::class);
3535

36-
$this->app->singleton(ActivityLogStatus::class);
36+
$this->app->scoped(ActivityLogStatus::class);
3737
}
3838

3939
public static function determineActivityModel(): string

0 commit comments

Comments
 (0)