cviebrock / eloquent-taggable

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

FindByName #63

Closed jasminetracey closed 7 years ago

jasminetracey commented 7 years ago

$articles = Tag::findByName($tag)->articles; Calling that throws the following error

Call to undefined method Illuminate\Database\Query\Builder::findByName()

I added article class to taggedModels 'taggedModels' => [ 'articles' => \App\Entities\Article::class ]

cviebrock commented 7 years ago

Which version of Laravel and which version of this package are you using?

jasminetracey commented 7 years ago

laravel 5.4, php 5.6, version 2.*

cviebrock commented 7 years ago

findByName and the taggedModels configuration were added in 3.*.

You'll need to update to at least version 3.0 of the package, preferably 3.1, although both of those will require PHP7 as well.