Skip to content

Commit 39d029d

Browse files
MrAtiebatietaylorotwell
authored andcommitted
Added a helper for testing the From address from a Mailable. (#18790)
1 parent 7b3bf0b commit 39d029d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Illuminate/Mail/Mailable.php

+12
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,18 @@ public function from($address, $name = null)
328328
return $this->setAddress($address, $name, 'from');
329329
}
330330

331+
/**
332+
* Determine if the given recipient is set on the mailable.
333+
*
334+
* @param object|array|string $address
335+
* @param string|null $name
336+
* @return bool
337+
*/
338+
public function hasFrom($address, $name = null)
339+
{
340+
return $this->hasRecipient($address, $name, 'from');
341+
}
342+
331343
/**
332344
* Set the recipients of the message.
333345
*

0 commit comments

Comments
 (0)