21 lines
672 B
PHP
21 lines
672 B
PHP
|
|
<?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,
|
||
|
|
]);
|
||
|
|
}
|
||
|
|
}
|