cviebrock / eloquent-taggable

Easily add the ability to tag your Eloquent models in Laravel.
MIT License
537 stars 72 forks source link

Tags array doesn't prevent duplicates #66

Closed sharafffffff closed 6 years ago

sharafffffff commented 6 years ago
$model->tag('SomeTag , SomeTag');
$this->assertEquals(1 , $model->isTagged()->count());

This test fails : Failed asserting that 2 matches expected 1. And it generates same result when passed as array also:

$model->tag(['SomeTag' , 'SomeTag']);
$this->assertEquals(1 , $model->isTagged()->count());

So they were considered two different tags, However making test like that passes

$model->tag('SomeTag');
$model->tag('SomeTag');
$this->assertEquals(1 , $model->isTagged()->count());
cviebrock commented 6 years ago

This is fixed in the 3.2.5 release. Thanks!

sharafffffff commented 6 years ago

Is there a fix for 3.1 for laravel 3.4?

cviebrock commented 6 years ago

Laravel 3.4?!