Skip to content

Commit

Permalink
Order delivered notification create message
Browse files Browse the repository at this point in the history
  • Loading branch information
Raccoon254 committed Jun 21, 2024
1 parent dabcce4 commit b94e4e4
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions app/Notifications/OrderDelivered.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Notifications;

use App\Models\Order;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
Expand All @@ -11,12 +12,14 @@ class OrderDelivered extends Notification
{
use Queueable;

private Order $order;

/**
* Create a new notification instance.
*/
public function __construct()
public function __construct(Order $order)
{
//
$this->order = $order;
}

/**
Expand All @@ -35,9 +38,10 @@ public function via(object $notifiable): array
public function toMail(object $notifiable): MailMessage
{
return (new MailMessage)
->line('The introduction to the notification.')
->action('Notification Action', url('/'))
->line('Thank you for using our application!');
->greeting('Hello ' . $this->order->user->name . '!')
->line('Your order has been delivered successfully.')
->action('View Order', route('orders.show', $this->order))
->line('Thank you for using our application!');
}

/**
Expand Down

0 comments on commit b94e4e4

Please sign in to comment.