I have this relationships:
ARTICLES
public function category()
{
return $this->belongsTo('App\Models\Categories');
}
CATEGORY have translations
public function c_translations()
{
return $this->hasMany('App\Models\CategoryTranslations', 'category_id');
}
In articles i have category id, also in translations i have category_id. So how can i count how many articles have each category. Any suggestion?
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2isjYoW
via IFTTT
Aucun commentaire:
Enregistrer un commentaire