I have followed the instructions, as per the README, but when trying to add a record, I get the following error: "Position.audit is not a function".
Here's an extract of my model and controller:
Models\Positions.js:
class Position extends Model {
boot () {
super.boot()
this.addTrait('@provider:Auditable')
}
}
Controllers\Http\PositionController.js:
class PositionController {
async store ({ request, response }) {
const data = request.all()
const position = await Position.audit().create(data)
return position
}
I have followed the instructions, as per the README, but when trying to add a record, I get the following error: "Position.audit is not a function".
Here's an extract of my model and controller:
Models\Positions.js:
Controllers\Http\PositionController.js: