It's a bit hacky, but it works:
Category::withCount(['translation as title' => function($query) {
$query->select('title');
}])->orderBy('title')->get();
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community