Closed ahmed-mohammed1 closed 3 years ago
Hello. More information needed:
ok Laravel v8.52.0 PHP v8.0.7 MySql v8.0.26 package 6.1
here is my Customer model class Customer extends Model implements \Bavix\Wallet\Interfaces\Customer { use Uuids, SoftDeletes, HasFactory, LogsActivity, CanPay; . . . }
and my Order model class Order extends Model implements Product, Taxable { use Uuids, SoftDeletes, HasFactory, LogsActivity, HasWallet; . . . public function canBuy(Customer $customer, int $quantity = 1, bool $force = null): bool { /**
return !$customer->paid($this); */ return true; }
public function getAmountProduct(Customer $customer) { return $this->total_amount; }
public function getMetaProduct(): ?array { return [ 'order_number' => $this->order_number, 'description' => 'Purchase of Order #' . $this->id, ]; }
public function getUniqueId(): string { return (string)$this->getKey(); }
public function getFeePercent() { return 0.03; // 3% } } and my controller $user = Auth::user(); return $user->balance;
i want to test the balance value. but it gave me that error
I have reproduced the problem. The problem is in the UUID of the user, at the moment you can only use integer values in the primary key.
Unfortunately, this problem cannot be fixed in the library. I've had many attempts to drag int and uuid into the library, but backward compatibility breaks a lot.
I am currently working on a draft for the next version and will pay special attention to UUIDs.
the problem arises in the connection between the wallet and the user, the package cannot create the wallet and we receive an error
This issue is stale because it has been open 30 days with no activity.
creating balance of the wallet by default not working when i use $user->balance it showing this error