class
Illuminate
/
Testing
/
Fluent
/
AssertableJson
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.
AssertableJson
Implements
- Illuminate\...\Arrayable
Uses
Properties
private
$props array
The properties in the current scope.
Default: null
private
$path string|null
The "dot" path to the current scope.
Default: null
Methods
protected
__construct ( array $props , string $path ) : void
Create a new fluent, assertable JSON data instance.
Parameters
- $props array
- $path string|null
protected
dotPath ( string $key ) : string
Compose the absolute "dot" path to the given key.
Parameters
- $key string
protected
prop ( string $key ) : mixed
Retrieve a prop within the current scope using "dot" notation.
Parameters
- $key string|null
protected
scope ( string $key , Closure $callback ) : $this
Instantiate a new "scope" at the path of the given key.
Parameters
- $key string
- $callback Closure
public
first ( Closure $callback ) : $this
Instantiate a new "scope" on the first child element.
Parameters
- $callback Closure
public
each ( Closure $callback ) : $this
Instantiate a new "scope" on each child element.
Parameters
- $callback Closure
public
static
fromArray ( array $data ) : static
Create a new instance from an array.
Parameters
- $data array
public
static
fromAssertableJsonString ( AssertableJsonString $json ) : static
Create a new instance from an AssertableJsonString.
Parameters
- $json AssertableJsonString
public
toArray ( ) : array
Get the instance as an array.