'decimal:2', 'completed_at' => 'datetime', 'quantity' => 'integer', ]; } protected static function booted(): void { static::creating(function (self $order): void { if (empty($order->uuid)) { $order->uuid = (string) Str::uuid(); } if (empty($order->reservation_code)) { // Generate a 6-character alphanumeric code $order->reservation_code = strtoupper(Str::random(6)); } }); } public function resident(): BelongsTo { return $this->belongsTo(User::class, 'resident_id'); } public function store(): BelongsTo { return $this->belongsTo(User::class, 'store_id'); } public function tenant(): BelongsTo { return $this->belongsTo(Tenant::class); } // Optional: relation to QrCode if the QrCode model exists // public function qrCode(): BelongsTo // { // return $this->belongsTo(QrCode::class); // } }