I am trying to modify the Policies function that is currently this:
public function pass(User $user, Product $product)
{
return $user->id == $product->user_id;
}
Let's see if I explain myself well .. I have some products that when trying to access them, check that the id
of the user is the same as the user_id
of the product who tries to access everything here perfect but what I also need is to create some products that are accessible to them by all users without restrictions that all users regardless of their id have access to them. for example I thought about using the user_id 1
in all products without restriction but do not consider how to make the function of free access to all products with user_id 1
any idea ??