در متد created فایل LikeObserver :
public function created(Like $like): void
{
$likeable = $like->likeable;
Cache::forget('likes_count_for_'. class_basename($likeable).'_'. $likeable->id);
Cache::forget('dislikes_count_for_'.class_basename($likeable).'_'.$likeable->id);
Cache::put('likes_count_for_'.class_basename($likeable).'_'. $likeable->id, $likeable->likes()->where('vote', 1)->count(), 3600);
Cache::put('dislikes_count_for_'.class_basename($likeable).'_'.$likeable->id, $likeable->likes()->where('vote', -1)->count(), 3600);
$like->likeable->user->notify(new ResourceWasLiked(class_basename($likeable)));
}