spatie / laravel-tags

Add tags and taggable behaviour to your Laravel app
https://freek.dev/609-an-opinionated-tagging-package-for-laravel-apps
MIT License
1.61k stars 281 forks source link

Update HasTags.php #507

Closed Sindoweb closed 3 months ago

Sindoweb commented 3 months ago

This change fixed an issue I encountered when returning tags with a type. $this->tags was Null. Fetching the tags (instead of relying on the variable) and filtering them resolved the (read: my) issue.

Sindoweb commented 3 months ago

Also in reference #[#279]

freekmurze commented 3 months ago

Mmmm, strange, I'm not inclined to merge this, as it would have a performance implication. A query would always be performed with the new code. Using the old code, the query would only be performed once.

Sindoweb commented 3 months ago

I understand - but the old code also fails.

I'm going to put a screenshot here just incase someone can make a better fix.

image
oxodesign commented 2 months ago

@Sindoweb check if you are casting "tags" as array in your model (or have a tag function/property in your model that conflicts with the package)! cc @freekmurze