Limiting number of records in .with()

Hi, I am querying for a list of forums and for each forum I want to get the last post.

This is my code

var forums = await Forum
      .query()
      .withCount('posts', (builder) => {
        builder.whereNull('in_reply_to')
      })
      .withCount('posts as replies_count', (builder) => {
        builder.whereNotNull('in_reply_to')
      })
      .with('posts', (builder) => {
        builder
          .orderBy('created_at', 'desc')
          .limit(1)
          .with('user')
          .whereNull('in_reply_to')
      })
      .with('aircraft')
      .where('active', 1)
      .fetch()

I thought that by using limit(1) I would get 1 post per forum, but in fact, it returns one post full stop and that is assigned to the first forum record and all other forums say there are no posts.

How do I get just the last post with each forum?