add notifications logic and add support of both JWT and Sanctum
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Notifications;
|
||||
|
||||
use App\Models\Notification;
|
||||
|
||||
class NotificationDeletedService
|
||||
{
|
||||
public function list(): array
|
||||
{
|
||||
$rows = Notification::getDeletedNotifications();
|
||||
|
||||
$notifications = array_map(static function ($row) {
|
||||
return [
|
||||
'id' => $row['id'] ?? null,
|
||||
'title' => $row['title'] ?? null,
|
||||
'message' => $row['message'] ?? null,
|
||||
'priority' => $row['priority'] ?? null,
|
||||
'scheduled_at' => $row['scheduled_at'] ?? null,
|
||||
'expires_at' => $row['expires_at'] ?? null,
|
||||
'deleted_at' => $row['deleted_at'] ?? null,
|
||||
];
|
||||
}, $rows ?? []);
|
||||
|
||||
return ['notifications' => $notifications];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user