
Latest questions: 492 php - Why is strcmp returning false on the second run? 794 symfony - php-fpm slow log: curl_multi_select takes over 10 sec 370 php - Symfony 4 - SQLSTATE No such file or directory 593 php - Laravel counted price issue 423 php - ftp_nlist(): Unable to create temporary file. I want to show in categories blade article with category_id and with multi categories but don't know how to get data from pivot table Return $this->belongsToMany(Article::class, 'articles_categories', 'category_id', 'article_id')Īnd in blade i tried something like this as as $many) Microsoft Pivot Tables & Pivot Charts should be in every data visualization toolbox as they are one of the most. Return $this->hasMany(Article::class, 'category_id', 'id')->orderBy('published_at', 'Desc') We can help you to become a Pivot Table expert. Return $this->belongsToMany(AllCategory::class, 'articles_categories', 'article_id', 'category_id')Ĭategories model: public function articles() Return $this->belongsTo(AllCategory::class, 'category_id', 'id')

>with('categoryArticles', $categoryArticles) $categoryArticles = $category->articles()->get() Now i added one category with category_id and multi categories with pivot table but i can't appearance pivot table data in categories blade. I have Articles table and it haves category_id witch is related to Categories table.īut now i added + articles_categories pivot table.
