simply keep a relation table of products the user purchased (user_id, product_id) . then check it on the controller.
public function hasPayed($product_id)
{
return in_array($product_id, $this->products->pluck('id')->all());
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community