Dingo\Api\Http\Response::meta PHP Method

meta() public method

Add a meta key and value pair.
public meta ( string $key, mixed $value ) : Response
$key string
$value mixed
return Response
    public function meta($key, $value)
    {
        return $this->addMeta($key, $value);
    }

Usage Example

 public function testAddingAndSettingMetaCallsUnderlyingTransformerBinding()
 {
     $binding = new Binding(m::mock('Illuminate\\Container\\Container'), 'foo');
     $response = new Response('test', 200, [], $binding);
     $response->setMeta(['foo' => 'bar']);
     $response->meta('bing', 'bang');
     $this->assertEquals(['foo' => 'bar', 'bing' => 'bang'], $response->getMeta());
 }