get(['id', 'name', 'type', 'pos_x', 'pos_y', 'pos_z', 'width', 'height', 'depth', 'is_open']) ->map(fn (Store $store): array => [ 'id' => $store->id, 'name' => $store->name, 'type' => $store->type, 'position' => [(float) $store->pos_x, (float) $store->pos_y, (float) $store->pos_z], 'size' => [(float) $store->width, (float) $store->height, (float) $store->depth], 'is_open' => $store->is_open, ]); $agents = AiAgent::query() ->where('status', '!=', 'paused') ->get(['id', 'name', 'type', 'status', 'pos_x', 'pos_y', 'pos_z', 'rotation_y']) ->map(fn (AiAgent $agent): array => [ 'id' => $agent->id, 'name' => $agent->name, 'type' => $agent->type, 'status' => $agent->status, 'position' => [(float) $agent->pos_x, (float) $agent->pos_y, (float) $agent->pos_z], 'rotation_y' => (float) $agent->rotation_y, ]); return response()->json([ 'generated_at' => now()->toIso8601String(), 'stores' => $stores, 'agents' => $agents, ]); } }