protected function hasRecipient($address, $name = null, $property = 'to')
    {
        $expected = $this->normalizeRecipient(
            $this->addressesToArray($address, $name)[0]
        );

        $expected = [
            'name' => $expected->name ?? null,
            'address' => $expected->email,
        ];

        return collect($this->{$property})->contains(function ($actual) use ($expected) {
            if (! isset($expected['name'])) {
                return $actual['address'] == $expected['address'];
            }

            return $actual == $expected;
        });
    }
protected function hasRecipient($address, $name = null, $property = 'to')
    {
        $expected = $this->normalizeRecipient(
            $this->addressesToArray($address, $name)[0]
        );

        $expected = [
            'name' => $expected->name ?? null,
            'address' => $expected->email,
        ];

        return collect($this->{$property})->contains(function ($actual) use ($expected) {
            if (! isset($expected['name'])) {
                return $actual['address'] == $expected['address'];
            }

            return $actual == $expected;
        });
    }
protected function hasRecipient ( $ address , $ name = null , $ property = 'to' ) { $ expected = $ this -> normalizeRecipient ( $ this -> addressesToArray ( $ address , $ name ) [ 0 ] ) ; $ expected = [ 'name' => $ expected -> name ?? null , 'address' => $ expected -> email , ] ; return collect ( $ this -> { $ property } ) -> contains ( function ( $ actual ) use ( $ expected ) { if ( ! isset ( $ expected [ 'name' ] ) ) { return $ actual [ 'address' ] == $ expected [ 'address' ] ; } return $ actual == $ expected ; } ) ; }
Determine if the given recipient is set on the mailable.

@param  object|array|string  $address
@param  string|null  $name
@param  string  $property
@return bool
Determine if the given recipient is set on the mailable .