hasMany(GiftCardCodes::class, 'giftcard_id', 'id'); } public function customer() { return $this->belongsTo(Customer::class, 'customer_id', 'id')->select('id', 'name', 'mobile'); } static $STS = [ 1 => "فعال", 2 => "تمام شده", 3 => "منقضی شده" ]; static $UNIT = [ 1=>'IRR', 2=>'Golden' ]; public function getStsStrAttribute() { return self::$STS[$this->sts] ?? null; } }