added vue time ago component

added custom field for booking updated notification
updated fetch notification on frontend
This commit is contained in:
Jack Goh
2018-08-30 16:04:14 +08:00
parent 8cfad4af99
commit d56f185c69
8 changed files with 2246 additions and 2056 deletions
+11 -20
View File
@@ -13,16 +13,18 @@ use App\Booking;
class BookingUpdated extends Notification
{
use Queueable;
protected $booking;
protected $details;
protected $link;
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct(Booking $booking)
public function __construct($details, $link)
{
$this->booking = $booking;
$this->details = $details;
$this->link = $link;
}
/**
@@ -36,24 +38,11 @@ class BookingUpdated extends Notification
return ['database', 'broadcast'];
}
// /**
// * Get the mail representation of the notification.
// *
// * @param mixed $notifiable
// * @return \Illuminate\Notifications\Messages\MailMessage
// */
// public function toMail($notifiable)
// {
// return (new MailMessage)
// ->line('The introduction to the notification.')
// ->action('Notification Action', url('/'))
// ->line('Thank you for using our application!');
// }
public function toDatabase($notifiable)
{
return [
'booking_id' => $this->booking->id
'details' => $this->details,
'link' => $this->link
];
}
@@ -66,14 +55,16 @@ class BookingUpdated extends Notification
public function toArray($notifiable)
{
return [
'booking' => $this->booking,
'details' => $this->details,
'link' => $this->link
];
}
public function toBroadcast($notifiable)
{
return new BroadcastMessage([
'booking' => $this->booking,
'details' => $this->details,
'link' => $this->link
]);
}
}