ALPHA 3.0.2a

This commit is contained in:
TheGamecraft
2018-09-10 08:51:18 -04:00
parent 7fe13ae0a7
commit 0e0ef86b71
1404 changed files with 10604 additions and 33714 deletions

View File

@@ -186,7 +186,7 @@ class MailChannel
return collect($recipients)->mapWithKeys(function ($recipient, $email) {
return is_numeric($email)
? [(is_string($recipient) ? $recipient : $recipient->email)]
? [$email => (is_string($recipient) ? $recipient : $recipient->email)]
: [$email => $recipient];
})->all();
}

View File

@@ -33,7 +33,7 @@ class SlackWebhookChannel
*
* @param mixed $notifiable
* @param \Illuminate\Notifications\Notification $notification
* @return \Psr\Http\Message\ResponseInterface
* @return void
*/
public function send($notifiable, Notification $notification)
{

View File

@@ -2,6 +2,9 @@
namespace Illuminate\Notifications\Messages;
use Traversable;
use Illuminate\Contracts\Support\Arrayable;
class MailMessage extends SimpleMessage
{
/**
@@ -144,7 +147,11 @@ class MailMessage extends SimpleMessage
*/
public function replyTo($address, $name = null)
{
$this->replyTo[] = [$address, $name];
if ($this->arrayOfAddresses($address)) {
$this->replyTo += $this->parseAddresses($address);
} else {
$this->replyTo[] = [$address, $name];
}
return $this;
}
@@ -152,13 +159,17 @@ class MailMessage extends SimpleMessage
/**
* Set the cc address for the mail message.
*
* @param string $address
* @param array|string $address
* @param string|null $name
* @return $this
*/
public function cc($address, $name = null)
{
$this->cc[] = [$address, $name];
if ($this->arrayOfAddresses($address)) {
$this->cc += $this->parseAddresses($address);
} else {
$this->cc[] = [$address, $name];
}
return $this;
}
@@ -166,13 +177,17 @@ class MailMessage extends SimpleMessage
/**
* Set the bcc address for the mail message.
*
* @param string $address
* @param array|string $address
* @param string|null $name
* @return $this
*/
public function bcc($address, $name = null)
{
$this->bcc[] = [$address, $name];
if ($this->arrayOfAddresses($address)) {
$this->bcc += $this->parseAddresses($address);
} else {
$this->bcc[] = [$address, $name];
}
return $this;
}
@@ -230,4 +245,30 @@ class MailMessage extends SimpleMessage
{
return array_merge($this->toArray(), $this->viewData);
}
/**
* Parse the multi-address array into the necessary format.
*
* @param array $value
* @return array
*/
protected function parseAddresses($value)
{
return collect($value)->map(function ($address, $name) {
return [$address, is_numeric($name) ? null : $name];
})->values()->all();
}
/**
* Determine if the given "address" is actually an array of addresses.
*
* @param mixed $address
* @return bool
*/
protected function arrayOfAddresses($address)
{
return is_array($address) ||
$address instanceof Arrayable ||
$address instanceof Traversable;
}
}

View File

@@ -25,7 +25,7 @@ class SendQueuedNotifications implements ShouldQueue
public $notification;
/**
* All of the channels to send the notification too.
* All of the channels to send the notification to.
*
* @var array
*/