complete story 8.5 with qa tests

This commit is contained in:
Naser Mansour
2026-01-02 22:22:43 +02:00
parent b289c31513
commit b7a84f83a5
7 changed files with 581 additions and 41 deletions
+5 -22
View File
@@ -2,10 +2,11 @@
namespace App\Notifications;
use App\Mail\BookingRejectedEmail;
use App\Models\Consultation;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Mail\Mailable;
use Illuminate\Notifications\Notification;
class BookingRejected extends Notification implements ShouldQueue
@@ -33,28 +34,10 @@ class BookingRejected extends Notification implements ShouldQueue
/**
* Get the mail representation of the notification.
*/
public function toMail(object $notifiable): MailMessage
public function toMail(object $notifiable): Mailable
{
$locale = $notifiable->preferred_language ?? 'ar';
return (new MailMessage)
->subject($this->getSubject($locale))
->view('emails.booking-rejected', [
'consultation' => $this->consultation,
'rejectionReason' => $this->rejectionReason,
'locale' => $locale,
'user' => $notifiable,
]);
}
/**
* Get the subject based on locale.
*/
private function getSubject(string $locale): string
{
return $locale === 'ar'
? 'بخصوص طلب الاستشارة الخاص بك'
: 'Regarding Your Consultation Request';
return (new BookingRejectedEmail($this->consultation, $this->rejectionReason))
->to($notifiable->email);
}
/**