Bugfix for a bug when adding a tag in a rule

This commit is contained in:
Robert Horlings 2016-02-24 14:06:11 +01:00
parent 3a4fc65712
commit 1732acfee2

View File

@ -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);
}