Get Count Of Relationship Table Laravel

[Solved] Get Count Of Relationship Table Laravel | Php Frameworks Yii - Code Explorer | yomemimo.com
Question : get count of relationship table laravel

Answered by : repzlaw

Category::where('parent_id', 0)->withCount('articles')->get();

Source : https://stackoverflow.com/questions/41165726/laravel-eloquent-get-relation-count | Last Update : Tue, 14 Sep 21

Answers related to get count of relationship table laravel

Code Explorer Popular Question For Php Frameworks Yii