Laravel testing POST JSON

Viewed 28

I am writing test in laravel. I want o send JSON in post. Below is the image

enter image description here

How can i send the json data in postJson ?

/**
     * A basic feature test example.
     *
     * @return void
     */
    public function test_create_attribute()
    {
        $response =  $this->postJson('/api/catalog/attributes?storeId=1000000006', How to send json data);

        $response->assertStatus(201);
    }
1 Answers
Related