From bac1ea138658e40de0676a20bf48d679718d2064 Mon Sep 17 00:00:00 2001 From: Olivier Legat Date: Sun, 20 Mar 2022 11:58:05 +0100 Subject: [PATCH] user or customer (various gates) for product policy --- app/Policies/ProductPolicy.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Policies/ProductPolicy.php b/app/Policies/ProductPolicy.php index d9d1d6ea..317ea186 100644 --- a/app/Policies/ProductPolicy.php +++ b/app/Policies/ProductPolicy.php @@ -23,7 +23,10 @@ class ProductPolicy // } - public function addToCart(Customers $user = null, Product $product) { + /** + * $user is a App\Models\User or a App\Models\Customers + */ + public function addToCart($user = null, Product $product) { $now = Carbon::now(); if($product->orderable_start === null or $product->orderable_start <= $now) { //on est entré dans la période commandable ou c'est commandable depuis toujours