jeudi 30 août 2018

How to get allTags() in laravel from a filtered model

I have two models Song and Album.

Song is Taggable(using eloquent-taggable).

1)Song belongs_to Album.

Album has columns name and language.

I want to get all tags of Song for a particular Album language.

I tried

Song::join('albums','albums.id','=','songs.album_id')
     ->where('albums.language', 'hindi')
     ->allTags()->orderBy('count', 'DESC')->get(); 

But not working.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire