UserService.php 398 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace App\Services;
  3. use App\Models\User;
  4. class UserService
  5. {
  6. public $user;
  7. public function __construct(User $user)
  8. {
  9. $this->user = $user;
  10. }
  11. public function isAvailable()
  12. {
  13. if ($this->user->transfer_enable && ($this->user->expired_at > time() || $this->user->expired_at == 0)) {
  14. return true;
  15. }
  16. return false;
  17. }
  18. }