Repository
class Repository implements ArrayAccess, Repository
Traits
Properties
| static protected array | $macros | The registered string macros. |
from Macroable |
| protected Closure|null | $mutationObserver | The observer invoked after each configuration mutation. |
Methods
Mix another object into the class.
Dynamically handle calls to the class.
Dynamically handle calls to the class.
Create a new configuration repository.
Determine if the given configuration value exists.
Get the specified configuration value.
Get many configuration values.
Get the specified string configuration value.
Get the specified integer configuration value.
Get the specified float configuration value.
Get the specified boolean configuration value.
Get the specified array configuration value.
Get the specified configuration value as a Collection.
Set a given configuration value.
Prepend a value onto an array configuration value.
Push a value onto an array configuration value.
Get all of the configuration items for the application.
Replace all configuration items without reporting a mutation.
Determine if the given configuration option exists.
Get a configuration option.
Set a configuration option.
Unset a configuration option.
Flush all static state.
Details
in
Macroable at line 28
static void
macro(string $name, callable|object $macro)
Register a custom macro.
Boot-only. Macros persist in a static property for the worker lifetime and apply to every subsequent call on the macroable class.
in
Macroable at line 41
static void
mixin(object $mixin, bool $replace = true)
Mix another object into the class.
Boot-only. Delegates to macro() for each method; registered macros persist in a static property for the worker lifetime.
in
Macroable at line 57
static bool
hasMacro(string $name)
Check if macro is registered.
in
Macroable at line 68
static void
flushMacros()
Flush the existing macros.
Boot or tests only. Clears worker-wide macros; concurrent coroutines may resolve different methods depending on timing.
in
Macroable at line 78
static mixed
__callStatic(string $method, array $parameters)
Dynamically handle calls to the class.
in
Macroable at line 103
mixed
__call(string $method, array $parameters)
Dynamically handle calls to the class.
at line 27
__construct(array $items = [])
Create a new configuration repository.
at line 34
bool
has(string $key)
Determine if the given configuration value exists.
at line 42
mixed
get(array|string $key, mixed $default = null)
Get the specified configuration value.
at line 54
array
getMany(array $keys)
Get many configuration values.
at line 75
string
string(string $key, mixed $default = null)
Get the specified string configuration value.
at line 94
int
integer(string $key, mixed $default = null)
Get the specified integer configuration value.
at line 113
float
float(string $key, mixed $default = null)
Get the specified float configuration value.
at line 132
bool
boolean(string $key, mixed $default = null)
Get the specified boolean configuration value.
at line 152
array
array(string $key, mixed $default = null)
Get the specified array configuration value.
at line 172
Collection
collection(string $key, mixed $default = null)
Get the specified configuration value as a Collection.
at line 184
void
set(array|string $key, mixed $value = null)
Set a given configuration value.
Boot or tests only. The config repository is a process-global singleton; per-request mutation races across coroutines and affects every concurrent request.
at line 204
void
prepend(string $key, mixed $value)
Prepend a value onto an array configuration value.
Boot or tests only. The config repository is a process-global singleton; per-request mutation races across coroutines and affects every concurrent request.
at line 220
void
push(string $key, mixed $value)
Push a value onto an array configuration value.
Boot or tests only. The config repository is a process-global singleton; per-request mutation races across coroutines and affects every concurrent request.
at line 232
array
all()
Get all of the configuration items for the application.
at line 242
void
replaceItems(array $items)
| internal |
Replace all configuration items without reporting a mutation.
at line 252
void
setMutationObserver(Closure $observer)
| internal |
Set the observer invoked after each configuration mutation.
at line 262
bool
offsetExists(int|string $key)
Determine if the given configuration option exists.
at line 272
mixed
offsetGet(int|string $key)
Get a configuration option.
at line 287
void
offsetSet(int|string $key, mixed $value)
Set a configuration option.
Boot or tests only. The config repository is a process-global singleton; per-request mutation races across coroutines and affects every concurrent request.
at line 301
void
offsetUnset(int|string $key)
Unset a configuration option.
Boot or tests only. The config repository is a process-global singleton; per-request mutation races across coroutines and affects every concurrent request.
at line 309
static void
flushState()
Flush all static state.