I have imported a few classes in Adonis
const User = use('App/Models/User')
const Orders = use('App/Models/Orders')
I want to be able to access one of the above classes dynamically. By that I mean a variable will hold the class I want to access. The variable will be populated by via an API call from the user.
let className = 'Orders'
How to I use the className variable to access the Orders class.
I have tried
[className].query().where('orderNumber','123').fetch()
However that does not seem to work.