lundi 28 novembre 2016

How to display all tags translations for article?

I have this relationships:

article:

  public function tags(){
        return $this->belongsToMany('App\Models\ATags', 'article_tags','article_id', 'article_tag_id');
    }

tags:

public function tags_trans()
    {
        return $this->hasMany('App\Models\ATagsTranslations', 'tag_id');
    }

So how can i display tags translations for that article?

I tried this but i get only last one.

foreach($tags as $tag){
          $user_tags[] = $tag->tags_trans;
        }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire