Answer the question
In order to leave comments, you need to log in
Why can't I see the status?
I want to test the status. But it only works that way and I don't understand why? Can someone tell me how to do it right
$order = factory(Order::class)->create();
$order->setStatus('status');
$status = $order->status; // null
$status = Order::find($order->order_id)->status; // find status
public function setStatus($status, $timestamp = null)
{
return $this->status()->create([
'status' => $status,
'timestamp' => $timestamp
]);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question