mirror of
https://gitlab.com/omair-personal/exchange.git
synced 2026-08-19 20:44:13 +00:00
d56f185c69
added custom field for booking updated notification updated fetch notification on frontend
71 lines
1.5 KiB
PHP
71 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Notifications;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Notifications\Notification;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Notifications\Messages\MailMessage;
|
|
use Illuminate\Broadcasting\PrivateChannel;
|
|
use Illuminate\Notifications\Messages\BroadcastMessage;
|
|
use App\Booking;
|
|
|
|
class BookingUpdated extends Notification
|
|
{
|
|
use Queueable;
|
|
protected $details;
|
|
protected $link;
|
|
|
|
/**
|
|
* Create a new notification instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct($details, $link)
|
|
{
|
|
$this->details = $details;
|
|
$this->link = $link;
|
|
}
|
|
|
|
/**
|
|
* Get the notification's delivery channels.
|
|
*
|
|
* @param mixed $notifiable
|
|
* @return array
|
|
*/
|
|
public function via($notifiable)
|
|
{
|
|
return ['database', 'broadcast'];
|
|
}
|
|
|
|
public function toDatabase($notifiable)
|
|
{
|
|
return [
|
|
'details' => $this->details,
|
|
'link' => $this->link
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Get the array representation of the notification.
|
|
*
|
|
* @param mixed $notifiable
|
|
* @return array
|
|
*/
|
|
public function toArray($notifiable)
|
|
{
|
|
return [
|
|
'details' => $this->details,
|
|
'link' => $this->link
|
|
];
|
|
}
|
|
|
|
public function toBroadcast($notifiable)
|
|
{
|
|
return new BroadcastMessage([
|
|
'details' => $this->details,
|
|
'link' => $this->link
|
|
]);
|
|
}
|
|
}
|