Files
eatvio-infra/app/Notifications/ConsultantRequestStarted.php
2024-01-15 01:05:10 +03:00

68 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;
public 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),
];
}
}