Files
numstation-web/app/helpers.php

21 lines
672 B
PHP
Raw Normal View History

2023-12-22 12:35:55 +08:00
<?php
use App\Models\UserNotification;
if (! function_exists('storeUserNotification')) {
function storeUserNotification($userId, $title, $description = null, $category = null, $isAdmin = false, $targetId = null, $targetType = null, $status = 'success', $isRead = false)
{
return UserNotification::create([
'user_id' => $userId,
'title' => $title,
'description' => $description,
'category' => $category,
'target_id' => $targetId,
'target_type' => $targetType,
'is_read' => $isRead,
'is_admin' => $isAdmin,
'status' => $status,
]);
}
}