class Repository

Stub implementation of Laravel's Log Context Repository.

Laravel 12's scheduling system expects this class to exist in the container as \Illuminate\Log\Context\Repository. Since Flarum uses a simplified logging setup with Monolog directly, we provide a minimal stub that returns empty context data. This is aliased to \Illuminate\Log\Context\Repository in the container. This is sufficient for Laravel 12 compatibility as Flarum doesn't use Laravel's context system for passing data between processes.

Methods

bool
has(string $key)

Determine if the given key exists in the context.

bool
missing(string $key)

Determine if the given key is missing from the context.

array
all()

Get all context data.

mixed
get(string $key, mixed $default = null)

Get a context value.

add(string|array $key, mixed $value = null)

Add a context value.

addHidden(string|array $key, mixed $value = null)

Add a hidden context value.

forget(string|array $key)

Forget a context key.

forgetHidden(string|array $key)

Forget a hidden context key.

array
allHidden()

Get all hidden context data.

flush()

Flush all context data.

array
dehydrate()

Dehydrate the context data for serialization.

hydrate(array $context)

Hydrate the context from an array.

dehydrating(callable $callback)

Register a dehydrating callback.

hydrated(callable $callback)

Register a hydrated callback.

Details

bool has(string $key)

Determine if the given key exists in the context.

Parameters

string $key

Return Value

bool

bool missing(string $key)

Determine if the given key is missing from the context.

Parameters

string $key

Return Value

bool

array all()

Get all context data.

Return Value

array

mixed get(string $key, mixed $default = null)

Get a context value.

Parameters

string $key
mixed $default

Return Value

mixed

Repository add(string|array $key, mixed $value = null)

Add a context value.

Parameters

string|array $key
mixed $value

Return Value

Repository

Repository addHidden(string|array $key, mixed $value = null)

Add a hidden context value.

Parameters

string|array $key
mixed $value

Return Value

Repository

Repository forget(string|array $key)

Forget a context key.

Parameters

string|array $key

Return Value

Repository

Repository forgetHidden(string|array $key)

Forget a hidden context key.

Parameters

string|array $key

Return Value

Repository

array allHidden()

Get all hidden context data.

Return Value

array

Repository flush()

Flush all context data.

Return Value

Repository

array dehydrate()

Dehydrate the context data for serialization.

This method is called by Laravel's scheduler when passing context between processes. For Flarum, we return an empty array as we don't use Laravel's context system.

Return Value

array

Repository hydrate(array $context)

Hydrate the context from an array.

Parameters

array $context

Return Value

Repository

Repository dehydrating(callable $callback)

Register a dehydrating callback.

Parameters

callable $callback

Return Value

Repository

Repository hydrated(callable $callback)

Register a hydrated callback.

Parameters

callable $callback

Return Value

Repository