@@ -110,31 +110,25 @@ trait Users
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Checks if the given user has a pending invitation for the
 | 
			
		||||
     * provided Company.
 | 
			
		||||
     * Checks if the given user has a pending invitation.
 | 
			
		||||
     *
 | 
			
		||||
     * @return bool
 | 
			
		||||
     */
 | 
			
		||||
    public function hasPendingInvitation($company_id = null)
 | 
			
		||||
    public function hasPendingInvitation()
 | 
			
		||||
    {
 | 
			
		||||
        $company_id = $company_id ?: company_id();
 | 
			
		||||
 | 
			
		||||
        $invitation = UserInvitation::where('user_id', $this->id)->where('company_id', $company_id)->first();
 | 
			
		||||
        $invitation = UserInvitation::where('user_id', $this->id)->first();
 | 
			
		||||
 | 
			
		||||
        return $invitation ? true : false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Returns if the given user has a pending invitation for the
 | 
			
		||||
     * provided Company.
 | 
			
		||||
     * Returns if the given user has a pending invitation.
 | 
			
		||||
     *
 | 
			
		||||
     * @return null|UserInvitation
 | 
			
		||||
     */
 | 
			
		||||
    public function getPendingInvitation($company_id = null)
 | 
			
		||||
    public function getPendingInvitation()
 | 
			
		||||
    {
 | 
			
		||||
        $company_id = $company_id ?: company_id();
 | 
			
		||||
 | 
			
		||||
        $invitation = UserInvitation::where('user_id', $this->id)->where('company_id', $company_id)->first();
 | 
			
		||||
        $invitation = UserInvitation::where('user_id', $this->id)->first();
 | 
			
		||||
 | 
			
		||||
        return $invitation;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user