1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?php
- namespace App\Notifications;
- use Illuminate\Bus\Queueable;
- use Illuminate\Notifications\Notification;
- use Illuminate\Contracts\Queue\ShouldQueue;
- use Illuminate\Notifications\Messages\MailMessage;
- class TicketNotification extends Notification
- {
- use Queueable;
- protected $ticket,$action_type, $addedBy;
- /**
- * Create a new notification instance.
- *
- * @return void
- */
- public function __construct($ticket,$action_type, $addedBy, $comment=NULL)
- {
- $this->ticket = $ticket;
- $this->action_type = $action_type;
- $this->addedBy = $addedBy;
- $this->comment = $comment;
-
- //$this->assign_person = $assign_person;
-
- }
- /**
- * Get the notification's delivery channels.
- *
- * @param mixed $notifiable
- * @return array
- */
- public function via($notifiable)
- {
- return ['database'];
- }
- /**
- * Get the mail representation of the notification.
- *
- * @param mixed $notifiable
- * @return \Illuminate\Notifications\Messages\MailMessage
- */
- public function toDatabase($notifiable)
- {
- return [
- 'ticket' => $this->ticket,// ticket information
- 'action_type' => $this->action_type, // creator
- 'addedBy' => $this->addedBy, // creator
- 'comment' => $this->comment, // creator
- 'user' => $notifiable // send
- ];
- }
- /**
- * Get the array representation of the notification.
- *
- * @param mixed $notifiable
- * @return array
- */
- public function toArray($notifiable)
- {
- return [
- //
- ];
- }
- }
|