Reputation: 355
I have Article and Category models. A Category can have many Article. I select all active Article with as below:
$list = Article::with('category')->whereActive('Y')->get();
Is there anyway to get all Category models in $list collection? Thanks for supporting. PS: I am using Laravel 8.36
Upvotes: 2
Views: 137