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