Thank you for your reply , I tried to write this test for the first condition , since I don't need to test other conditions with : orWhereHas and whereHas , But I got " Expected status code 200 but received 500 "
You can add $this->withoutExceptionHandling() in your test method and see what is it complaining about. From what I see your URL seems bit strange. I guess instead of api/order/search you should have api/order/search/. Missing slash at the end.