Level 55
@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?
Summer Sale! All accounts are 50% off this week.
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.