File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,11 @@ interface Product extends Wallet
66{
77
88 /**
9+ * @param Customer $customer
10+ *
911 * @return bool
1012 */
11- public function canBuy (): bool ;
13+ public function canBuy (Customer $ customer ): bool ;
1214
1315 /**
1416 * @return int
Original file line number Diff line number Diff line change 77use Bavix \Wallet \Models \Transfer ;
88use Illuminate \Database \Eloquent \Model ;
99use Illuminate \Database \Eloquent \ModelNotFoundException ;
10- use Illuminate \Database \Eloquent \Relations \MorphMany ;
1110use Illuminate \Support \Facades \DB ;
1211
1312trait CanBePaid
@@ -22,7 +21,7 @@ trait CanBePaid
2221 */
2322 public function pay (Product $ product ): Transfer
2423 {
25- if (!$ product ->canBuy ()) {
24+ if (!$ product ->canBuy ($ this )) {
2625 throw new ProductEnded ('The product is out of stock ' );
2726 }
2827
You can’t perform that action at this time.
0 commit comments