rtconner / laravel-tagging

Tag support for Laravel Eloquent models - Taggable Trait
MIT License
882 stars 168 forks source link

allTags() missing #30

Closed ortix closed 9 years ago

ortix commented 9 years ago

Are you sure that the allTags() method/scope is in the trait? I can't seem to find it in the trait and it throws an exception when trying to use it.

oxxf7to

rtconner commented 9 years ago

Give code of how you are using it please.

ortix commented 9 years ago
class ShowRepository {
// using this as a temp wrapper
    public function allTags()
    {
        return Show::allTags();
    }
}

class Show extends \Eloquent
{
    use Laracasts\Presenter\PresentableTrait;
    use Conner\Tagging\TaggableTrait;

    // methods and properties...

    // very neat way to override the auto model form binding
    public function getGenreListAttribute()
    {
        return $this->tagged->lists('tag_slug');
    }
}

The exception thrown:

Call to undefined method Illuminate\Database\Query\Builder::allTags() 
rtconner commented 9 years ago

Check your version