You just need to somehow provide a value for the abstract methods in LoggedAction. If you want LoggedAction to stay an object, you can place your LoggedAction inside a class/trait that already has the body parsers available, for example:
trait MyActions { self: BaseController =>
object LoggedAction extends ActionBuilder[Request, AnyContent] {
override def parser: BodyParser[AnyContent] = self.parse.default
override protected def executionContext: ExecutionContext = self.defaultExecutionContext
// ...
}
}
Then you'd just mix in MyActions into your controller. The above example should work for any controller extending BaseController (including AbstractController and InjectedController). The helper trait is a good way if you have lots of different kinds of actions you want to use in the same controller.
Converting LoggedAction to a class and adding a constructor dependency on BodyParsers.Default will work as well:
class LoggedAction @Inject()(val parser: BodyParsers.Default, val executionContext: ExecutionContext)
extends ActionBuilder[Request, AnyContent] {
// ...
}
Then you would simply inject a `loggedAction: LoggedAction` into your constructor.
Play doesn't have an opinion on which way you choose.