public function isBuyer(User $user)
    {
        return (bool) $this->purchases()->whereHas('buyer', function ($query) use ($user) {
            return $query->where('user_id', $user->userId);
        })->count();
    }
public function isBuyer(User $user)
    {
        return (bool) $this->purchases()->whereHas('buyer', function ($query) use ($user) {
            return $query->where('user_id', $user->userId);
        })->count();
    }
public function isBuyer ( User $ user ) { return ( bool ) $ this -> purchases ( ) -> whereHas ( 'buyer' , function ( $ query ) use ( $ user ) { return $ query -> where ( 'user_id' , $ user -> userId ) ; } ) -> count ( ) ; }
Return true if user has ever purchased the item.

@param \Hamjoint\Mustard\User $user

@return bool
Return true if user has ever purchased the item .