trait HasAliasesTrait (View source)

Add methods to classes at runtime.

Loosely based on spatie/macroable.

Methods

void
alias(string $alias, string|Closure $target)

Register an alias.

boolean
hasAlias(string $alias)

Get whether an alias is registered.

__call($method, $parameters)

No description

mixed|null
resolve(string $key)

Resolve a dependency from the IoC container.

Details

void alias(string $alias, string|Closure $target)

Register an alias.

Parameters

string $alias
string|Closure $target

Return Value

void

boolean hasAlias(string $alias)

Get whether an alias is registered.

Parameters

string $alias

Return Value

boolean

__call($method, $parameters)

Parameters

$method
$parameters

abstract mixed|null resolve(string $key)

Resolve a dependency from the IoC container.

Parameters

string $key

Return Value

mixed|null