trait Illuminate / Support / Traits / Macroable
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.

Macroable

Properties

protected static

$macros array

The registered string macros.

Default: []

Methods

public static

macro ( $name , $macro ) : void

Register a custom macro.

Parameters

  • $name string
  • $macro object|callable
public static

mixin ( $mixin , $replace ) : void

Mix another object into the class.

Parameters

  • $mixin object
  • $replace bool
public static

hasMacro ( $name ) : bool

Checks if macro is registered.

Parameters

  • $name string
public static

flushMacros ( ) : void

Flush the existing macros.

public static

__callStatic ( $method , $parameters ) : mixed

Dynamically handle calls to the class.

Parameters

  • $method string
  • $parameters array
public

__call ( $method , $parameters ) : mixed

Dynamically handle calls to the class.

Parameters

  • $method string
  • $parameters array