update inbox list
This commit is contained in:
112
vendor/laravel/framework/src/Illuminate/Notifications/Events/BroadcastNotificationCreated.php
vendored
Normal file
112
vendor/laravel/framework/src/Illuminate/Notifications/Events/BroadcastNotificationCreated.php
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Notifications\Events;
|
||||
|
||||
use Illuminate\Broadcasting\PrivateChannel;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class BroadcastNotificationCreated implements ShouldBroadcast
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* The notifiable entity who received the notification.
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
public $notifiable;
|
||||
|
||||
/**
|
||||
* The notification instance.
|
||||
*
|
||||
* @var \Illuminate\Notifications\Notification
|
||||
*/
|
||||
public $notification;
|
||||
|
||||
/**
|
||||
* The notification data.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $data = [];
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
* @param \Illuminate\Notifications\Notification $notification
|
||||
* @param array $data
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($notifiable, $notification, $data)
|
||||
{
|
||||
$this->data = $data;
|
||||
$this->notifiable = $notifiable;
|
||||
$this->notification = $notification;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the channels the event should broadcast on.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function broadcastOn()
|
||||
{
|
||||
$channels = $this->notification->broadcastOn();
|
||||
|
||||
if (! empty($channels)) {
|
||||
return $channels;
|
||||
}
|
||||
|
||||
if (is_string($channels = $this->channelName())) {
|
||||
return [new PrivateChannel($channels)];
|
||||
}
|
||||
|
||||
return collect($channels)->map(function ($channel) {
|
||||
return new PrivateChannel($channel);
|
||||
})->all();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the broadcast channel name for the event.
|
||||
*
|
||||
* @return array|string
|
||||
*/
|
||||
protected function channelName()
|
||||
{
|
||||
if (method_exists($this->notifiable, 'receivesBroadcastNotificationsOn')) {
|
||||
return $this->notifiable->receivesBroadcastNotificationsOn($this->notification);
|
||||
}
|
||||
|
||||
$class = str_replace('\\', '.', get_class($this->notifiable));
|
||||
|
||||
return $class.'.'.$this->notifiable->getKey();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the data that should be sent with the broadcasted event.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function broadcastWith()
|
||||
{
|
||||
return array_merge($this->data, [
|
||||
'id' => $this->notification->id,
|
||||
'type' => $this->broadcastType(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the type of the notification being broadcast.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function broadcastType()
|
||||
{
|
||||
return method_exists($this->notification, 'broadcastType')
|
||||
? $this->notification->broadcastType()
|
||||
: get_class($this->notification);
|
||||
}
|
||||
}
|
||||
56
vendor/laravel/framework/src/Illuminate/Notifications/Events/NotificationFailed.php
vendored
Normal file
56
vendor/laravel/framework/src/Illuminate/Notifications/Events/NotificationFailed.php
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Notifications\Events;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class NotificationFailed
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* The notifiable entity who received the notification.
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
public $notifiable;
|
||||
|
||||
/**
|
||||
* The notification instance.
|
||||
*
|
||||
* @var \Illuminate\Notifications\Notification
|
||||
*/
|
||||
public $notification;
|
||||
|
||||
/**
|
||||
* The channel name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $channel;
|
||||
|
||||
/**
|
||||
* The data needed to process this failure.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $data = [];
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
* @param \Illuminate\Notifications\Notification $notification
|
||||
* @param string $channel
|
||||
* @param array $data
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($notifiable, $notification, $channel, $data = [])
|
||||
{
|
||||
$this->data = $data;
|
||||
$this->channel = $channel;
|
||||
$this->notifiable = $notifiable;
|
||||
$this->notification = $notification;
|
||||
}
|
||||
}
|
||||
47
vendor/laravel/framework/src/Illuminate/Notifications/Events/NotificationSending.php
vendored
Normal file
47
vendor/laravel/framework/src/Illuminate/Notifications/Events/NotificationSending.php
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Notifications\Events;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class NotificationSending
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* The notifiable entity who received the notification.
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
public $notifiable;
|
||||
|
||||
/**
|
||||
* The notification instance.
|
||||
*
|
||||
* @var \Illuminate\Notifications\Notification
|
||||
*/
|
||||
public $notification;
|
||||
|
||||
/**
|
||||
* The channel name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $channel;
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
* @param \Illuminate\Notifications\Notification $notification
|
||||
* @param string $channel
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($notifiable, $notification, $channel)
|
||||
{
|
||||
$this->channel = $channel;
|
||||
$this->notifiable = $notifiable;
|
||||
$this->notification = $notification;
|
||||
}
|
||||
}
|
||||
56
vendor/laravel/framework/src/Illuminate/Notifications/Events/NotificationSent.php
vendored
Normal file
56
vendor/laravel/framework/src/Illuminate/Notifications/Events/NotificationSent.php
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Notifications\Events;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class NotificationSent
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* The notifiable entity who received the notification.
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
public $notifiable;
|
||||
|
||||
/**
|
||||
* The notification instance.
|
||||
*
|
||||
* @var \Illuminate\Notifications\Notification
|
||||
*/
|
||||
public $notification;
|
||||
|
||||
/**
|
||||
* The channel name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $channel;
|
||||
|
||||
/**
|
||||
* The channel's response.
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
public $response;
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
* @param \Illuminate\Notifications\Notification $notification
|
||||
* @param string $channel
|
||||
* @param mixed $response
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($notifiable, $notification, $channel, $response = null)
|
||||
{
|
||||
$this->channel = $channel;
|
||||
$this->response = $response;
|
||||
$this->notifiable = $notifiable;
|
||||
$this->notification = $notification;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user