Current File : /home/tradevaly/www/app/Notifications/OrderSuccess.php |
<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class OrderSuccess extends Notification
{
use Queueable;
public $data;
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct($invoice)
{
$this->data = $invoice;
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return ['mail'];
}
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
->subject('Order Place Sucessfully')
->greeting('Hello ' . $this->data['name'])
->line('Thanks For purchase Product')
->line('Your order number is: '.$this->data['order_number'])
->line('Your transaction Id: '.$this->data['transaction_id'])
->line('Total Price: '.$this->data['amount'])
->line('Payment status: '.$this->data['payment'])
->action('Invoice', url('https://www.tradevaly.com.bd/user/product/invoice/'.$this->data['order_number']))
->line('Thank you for joining Tradvaly');
}
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toArray($notifiable)
{
return [
//
];
}
}