first&last

This commit is contained in:
sbb45
2026-03-20 15:47:17 +05:00
commit d6441abdd2
230 changed files with 20367 additions and 0 deletions
@@ -0,0 +1,42 @@
<?php
namespace App\Notifications;
use App\Models\ServiceRequest;
use App\Models\User;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class RequestCommentAddedNotification extends Notification implements ShouldQueue
{
use Queueable;
public function __construct(private readonly ServiceRequest $request, private readonly User $author)
{
}
public function via(object $notifiable): array
{
return ['database', 'mail'];
}
public function toMail(object $notifiable): MailMessage
{
return (new MailMessage)
->subject('Новый комментарий к заявке')
->line("{$this->author->name} добавил комментарий к заявке {$this->request->ticket_number}.")
->action('Открыть заявку', route('requests.show', $this->request));
}
public function toArray(object $notifiable): array
{
return [
'title' => 'Новый комментарий',
'message' => "{$this->author->name} добавил комментарий к {$this->request->ticket_number}",
'request_id' => $this->request->id,
'url' => route('requests.show', $this->request),
];
}
}