cviebrock / eloquent-taggable

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

withAllTags does not always work #133

Closed devkornev closed 7 months ago

devkornev commented 2 years ago

I do not know how to catch the problem. If you need additional information, tell me, I will try to provide.

Article::popularTagsNormalized(3)

array:3 [[]() "elementary os" => 36 "ubuntu" => 33 "debian" => 25 ]

Article::withAnyTags("elementary os")->get()

Illuminate\Database\Eloquent\Collection {[#1533 ]()

items: array:36 [[]()]

escapeWhenCastingToString: false

}

Article::withAllTags("elementary os")->get()

Illuminate\Database\Eloquent\Collection {[#1492 ]()

items: []

escapeWhenCastingToString: false

}

?????

Article::withAnyTags("ubuntu")->get()

Illuminate\Database\Eloquent\Collection {[#1534 ]()

items: array:33 [[]()]

escapeWhenCastingToString: false

}

Article::withAllTags("ubuntu")->get()

Illuminate\Database\Eloquent\Collection {[#1534 ]()

items: array:33 [[]()]

escapeWhenCastingToString: false

}

PHP 8.1.4 MySQL 8.0.28 Laravel 8.83.5

"cviebrock/eloquent-taggable": "^8.0",

config

return [ 'delimiters' => ',;', 'glue' => ',', 'normalizer' => 'mb_strtolower', 'connection' => null, 'throwEmptyExceptions' => false, 'taggedModels' => [ 'articles' => \App\Models\Article::class ], 'model' => \Cviebrock\EloquentTaggable\Models\Tag::class, ];

cviebrock commented 7 months ago

Closing old issue ... sorry I couldn't help.