diff --git a/app/Rules/Actions/AddTag.php b/app/Rules/Actions/AddTag.php index af28acc579..f1b4bd659f 100644 --- a/app/Rules/Actions/AddTag.php +++ b/app/Rules/Actions/AddTag.php @@ -47,7 +47,7 @@ class AddTag implements ActionInterface // journal has this tag maybe? $tag = Tag::firstOrCreateEncrypted(['tag' => $this->action->action_value, 'user_id' => Auth::user()->id]); - $count = $journal->tags()->where('id', $tag->id)->count(); + $count = $journal->tags()->where('tag_id', $tag->id)->count(); if ($count == 0) { $journal->tags()->save($tag); }