llp 3 дней назад
Родитель
Сommit
d5ce8ea175
1 измененных файлов с 11 добавлено и 0 удалено
  1. 11 0
      packages/Webkul/Customer/src/Models/Customer.php

+ 11 - 0
packages/Webkul/Customer/src/Models/Customer.php

@@ -107,7 +107,18 @@ class Customer extends Authenticatable implements CustomerContract
     {
         return ucfirst($this->first_name).' '.ucfirst($this->last_name);
     }
+    /**
+     * Get the isVip.
+     */
+    public function getIsVipAttribute(): string
+    {
+        if (!$this->vip_expire_date) {
+            return false;
+        }
 
+        $expireDate = \Carbon\Carbon::parse($this->vip_expire_date);
+        return !$expireDate->isPast();
+    }
     /**
      * Get image url for the customer image.
      *