Level 54
@shaungbhone are you sure your route is correct?
shouldn't
'/repiles'
be:
'/replies'
what does
$thread->path().'/repiles'
resolve to? do you have enough arguments for your store method?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi Guys, I got an error. a_thread_requires_a_body() is worked. a_reply_requires_a_body() is not worked. All are the same conditions.
/** @test */
function a_reply_requires_a_body()
{
$this->signIn();
$thread = create(Thread::class);
$reply = make(Reply::class, ['body' => null]);
$this->post($thread->path().'/repiles', $reply->toArray())
->assertSessionHasErrors('body');
}
repliescontroller.php
public function store($locale, $channelId, Thread $thread)
{
$this->validate(request(), [
'body' => 'required',
]);
}
@shaungbhone are you sure your route is correct?
shouldn't
'/repiles'
be:
'/replies'
what does
$thread->path().'/repiles'
resolve to? do you have enough arguments for your store method?
Please or to participate in this conversation.