Send users_count on event task
This commit is contained in:
@@ -140,7 +140,9 @@ class EventsController extends Controller
|
||||
public function getEvent(Request $request, int $id): JsonResponse {
|
||||
try {
|
||||
|
||||
$event = Event::find($id);
|
||||
$event = Event::with(['tasks' => function ($query) {
|
||||
$query->withCount('users');
|
||||
}])->find($id);
|
||||
return response()->json([
|
||||
"id" => $event->id,
|
||||
"name" => $event->name,
|
||||
|
||||
Reference in New Issue
Block a user