mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-09-29 21:13:05 -04:00
Initial commit
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Chat\Http\Controllers\API;
|
||||
|
||||
use Modules\Chat\Http\Controllers\AppBaseController;
|
||||
use App\Models\Notification;
|
||||
use Modules\Chat\Repositories\NotificationRepository;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
/**
|
||||
* Class NotificationController
|
||||
*/
|
||||
class NotificationController extends AppBaseController
|
||||
{
|
||||
/** @var NotificationRepository */
|
||||
private $notificationRepo;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param NotificationRepository $notificationRepository
|
||||
*/
|
||||
public function __construct(NotificationRepository $notificationRepository)
|
||||
{
|
||||
$this->notificationRepo = $notificationRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Notification $notification
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function readNotification(Notification $notification)
|
||||
{
|
||||
$this->notificationRepo->readNotification($notification->id);
|
||||
|
||||
return $this->sendResponse($notification, 'Message read successfully.');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function readAllNotification()
|
||||
{
|
||||
$messageSenderIds = $this->notificationRepo->readAllNotification();
|
||||
|
||||
return $this->sendResponse(['sender_ids' => $messageSenderIds], 'Read all messages successfully.');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user