diff --git a/app/Models/User.php b/app/Models/User.php index 36b98ca..0a29a22 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -5,6 +5,7 @@ // use Illuminate\Contracts\Auth\MustVerifyEmail; use App\Exceptions\User\BalanceNotEnoughException; use Carbon\Exceptions\InvalidFormatException; +use GeneaLabs\LaravelModelCaching\CachedBuilder; use GeneaLabs\LaravelModelCaching\Traits\Cachable; use Illuminate\Contracts\Encryption\DecryptException; use Illuminate\Database\Eloquent\Casts\Attribute; @@ -143,7 +144,7 @@ public function user_group(): BelongsTo return $this->belongsTo(UserGroup::class); } - public function scopeBirthday(): User + public function scopeBirthday(): User|CachedBuilder { /** @noinspection PhpUndefinedMethodInspection */ return $this->select(['id', 'name', 'birthday_at', 'email_md5', 'created_at'])->whereMonth('birthday_at', now()->month)