class Optional implements ArrayAccess (View source)
Macroable |
static protected array | $macros | The registered string macros. | from Macroable |
protected mixed | $value | The underlying object. |
static void | macro(string $name, object|callable $macro) Register a custom macro. | from Macroable |
static void | mixin(object $mixin, bool $replace = true) Mix another object into the class. | from Macroable |
static bool | hasMacro(string $name) Checks if macro is registered. | from Macroable |
static mixed | __callStatic(string $method, array $parameters) Dynamically handle calls to the class. | from Macroable |
mixed | __call(string $method, array $parameters) Dynamically pass a method to the underlying object. | |
void | __construct(mixed $value) Create a new optional instance. | |
mixed | __get(string $key) Dynamically access a property on the underlying object. | |
bool | __isset(mixed $name) Dynamically check a property exists on the underlying object. | |
bool | offsetExists(mixed $key) Determine if an item exists at an offset. | |
mixed | offsetGet(mixed $key) Get an item at a given offset. | |
void | offsetSet(mixed $key, mixed $value) Set the item at a given offset. | |
void | offsetUnset(string $key) Unset the item at a given offset. |
Register a custom macro.
Mix another object into the class.
Checks if macro is registered.
Dynamically handle calls to the class.
Dynamically pass a method to the underlying object.
Create a new optional instance.
Dynamically access a property on the underlying object.
Dynamically check a property exists on the underlying object.
Determine if an item exists at an offset.
Get an item at a given offset.
Set the item at a given offset.
Unset the item at a given offset.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/8.x/Illuminate/Support/Optional.html