- Added detailed notifications for users and admins upon acceptance, rejection, and submission of proposals, verifications, and reports. - Improved user experience with personalized messages and actionable links in notifications. - Refactored notification logic across various actions to ensure consistent messaging and clarity. - Introduced new notification titles and bodies to better reflect the status of actions taken.
37 lines
831 B
PHP
37 lines
831 B
PHP
<?php
|
|
|
|
namespace App\Notifications;
|
|
|
|
use Filament\Notifications\Notification as FilamentNotification;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Notifications\Notification;
|
|
|
|
class BroadcastNotification extends Notification
|
|
{
|
|
use Queueable;
|
|
|
|
public function __construct(
|
|
protected array $payload
|
|
) {
|
|
$this->payload = $payload;
|
|
}
|
|
|
|
public function via($notifiable): array
|
|
{
|
|
return ['database'];
|
|
}
|
|
|
|
public function toDatabase($notifiable): array
|
|
{
|
|
$notification = FilamentNotification::make()
|
|
->title($this->payload['title'])
|
|
->body($this->payload['body']);
|
|
|
|
if (! empty($this->payload['action'])) {
|
|
$notification->actions($this->payload['action']);
|
|
}
|
|
|
|
return $notification->getDatabaseMessage();
|
|
}
|
|
}
|