Skip to content

Commit

Permalink
Allow HtmlString as line in notifications MailMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
webkonstantin committed Dec 19, 2017
1 parent 298e6f2 commit f885e78
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/Illuminate/Notifications/Messages/SimpleMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Illuminate\Notifications\Messages;

use Illuminate\Support\HtmlString;
use Illuminate\Notifications\Action;

class SimpleMessage
Expand Down Expand Up @@ -141,7 +142,7 @@ public function salutation($salutation)
/**
* Add a line of text to the notification.
*
* @param \Illuminate\Notifications\Action|string $line
* @param \Illuminate\Notifications\Action|\Illuminate\Support\HtmlString|string $line
* @return $this
*/
public function line($line)
Expand All @@ -152,7 +153,7 @@ public function line($line)
/**
* Add a line of text to the notification.
*
* @param \Illuminate\Notifications\Action|string|array $line
* @param \Illuminate\Notifications\Action|\Illuminate\Support\HtmlString|string|array $line
* @return $this
*/
public function with($line)
Expand All @@ -171,11 +172,15 @@ public function with($line)
/**
* Format the given line of text.
*
* @param string|array $line
* @return string
* @param \Illuminate\Support\HtmlString|string|array $line
* @return \Illuminate\Support\HtmlString|string
*/
protected function formatLine($line)
{
if ($line instanceof HtmlString) {
return $line;
}

if (is_array($line)) {
return implode(' ', array_map('trim', $line));
}
Expand Down

0 comments on commit f885e78

Please sign in to comment.