I use Laravel 5.3.
I have 2 tables :
Articles --------- id cat_id title
And
Category --------- id parent_id title
you can use withCount(). It is available from 5.3 version
withCount()
for more info about eloquent visit : https://laravel.com/docs/5.3/eloquent-relationships