kirim notification
This commit is contained in:
@@ -209,8 +209,8 @@ class ChatDoctorController extends Controller
|
|||||||
if ($user->nIDUser) { // Jika Dependent yang request
|
if ($user->nIDUser) { // Jika Dependent yang request
|
||||||
$user = UserLMS::where('nIDUser',$livechat->patient_id)->first();
|
$user = UserLMS::where('nIDUser',$livechat->patient_id)->first();
|
||||||
}
|
}
|
||||||
$user->notify(new SendNotification($title, $body, $dataNotif));
|
$user->notify(new SendNotification($title, $body, $dataNotif));
|
||||||
return ApiResponse::apiResponse("Success",['message' => 'Livechat updated successfully'], trans('Message.success'), 200);
|
return ApiResponse::apiResponse("Success",['message' => 'Livechat updated successfully'], trans('Message.success'), 200);
|
||||||
} else {
|
} else {
|
||||||
return Helper::responseJson(
|
return Helper::responseJson(
|
||||||
status: 'Not Found',
|
status: 'Not Found',
|
||||||
@@ -328,8 +328,25 @@ class ChatDoctorController extends Controller
|
|||||||
'type' => 'summary'
|
'type' => 'summary'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
// Send Pusher
|
||||||
ChatMessageSent::dispatch($message);
|
ChatMessageSent::dispatch($message);
|
||||||
|
|
||||||
|
$title = 'Decline Livechat';
|
||||||
|
$body = 'Decline Livechat';
|
||||||
|
$dataNotif = [
|
||||||
|
'channel_id' => (string) $channel->id,
|
||||||
|
'livechat_id' => (string) $livechat->id,
|
||||||
|
'type' => 'summary-chat'
|
||||||
|
];
|
||||||
|
$user = UserLMS::where('nID',$livechat->patient_id)->first();
|
||||||
|
if ($user) {
|
||||||
|
if ($user->nIDUser) { // Jika Dependent yang request
|
||||||
|
$user = UserLMS::where('nIDUser',$livechat->patient_id)->first();
|
||||||
|
}
|
||||||
|
$user->notify(new SendNotification($title, $body, $dataNotif));
|
||||||
|
return ApiResponse::apiResponse("Success",['message' => 'Livechat updated successfully'], trans('Message.success'), 200);
|
||||||
|
}
|
||||||
|
|
||||||
return ApiResponse::apiResponse("Success",['message' => 'Livechat updated successfully'], trans('Message.success'), 200);
|
return ApiResponse::apiResponse("Success",['message' => 'Livechat updated successfully'], trans('Message.success'), 200);
|
||||||
} else {
|
} else {
|
||||||
return response()->json(['message' => 'Livechat not found'], 404);
|
return response()->json(['message' => 'Livechat not found'], 404);
|
||||||
|
|||||||
Reference in New Issue
Block a user