how to user and user data count to other table relation laravel relation code example
Example: eloquent relationships
$roles = App\User::find(1)->roles()->orderBy('name')->get();
$roles = App\User::find(1)->roles()->orderBy('name')->get();