Files
eatvio-infra/app/Notifications/ConsultantRequestStarted.php
2023-10-04 17:57:09 +03:00

69 lines
1.6 KiB
PHP

<?php
namespace App\Notifications;
use App\Models\ConsultantEducation;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class ConsultantRequestStarted extends Notification implements ShouldQueue
{
use Queueable;
private ConsultantEducation $education;
/**
* Create a new notification instance.
*/
public function __construct(ConsultantEducation $education)
{
$this->afterCommit();
$this->education = $education;
//
}
/**
* Get the notification's delivery channels.
*
* @return array<int, string>
*/
public function via(object $notifiable): array
{
return ['mail'];
}
/**
* Get the mail representation of the notification.
*/
public function toMail(object $notifiable): MailMessage
{
return (new MailMessage)
->subject('[Eatvio] New Consultant request')
->line('User: ' . $notifiable->name . " send Consultant request")
->action('Notification Action', route('profile.show', $notifiable))
->line('Thank you for using our application!');
}
/**
* Get the array representation of the notification.
*
* @return array<string, mixed>
*/
public function toArray(object $notifiable): array
{
return [
//
];
}
public function withDelay(object $notifiable): array
{
return [
'mail' => now()->addMinutes(5),
'sms' => now()->addMinutes(10),
];
}
}