user or customer (various gates) for product policy
This commit is contained in:
parent
6c32f37e40
commit
bac1ea1386
1 changed files with 4 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue