File: /home/imensosw/www/mpl.imenso.co/app/Listeners/RemoveUserLikedYourCommentOnPostNotification.php
<?php
namespace App\Listeners;
use App\Events\UserUnlikesCommentOnPost;
class RemoveUserLikedYourCommentOnPostNotification
{
/**
* Create the event listener.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Handle the event.
*
* @param UserUnlikesCommentOnPost $event
* @return void
*/
public function handle(UserUnlikesCommentOnPost $event)
{
if ($event->comment->user->id != $event->liker->id) {
$event->comment->user->removeNotification(
1, [
'comment_id' => $event->comment->id,
'liker_id' => $event->liker->id,
]
);
}
}
}