adonis-audit 2.1.1
Install from the command line:
Learn more about npm packages
$ npm install @ks-labs/adonis-audit@2.1.1
Install via package.json:
"@ks-labs/adonis-audit": "2.1.1"
About this version
Audit models in AdonisJS
This is just a release for using it through NPM. Not claiming any rights over the original code developed.
Install npm module:
$ adonis install adonis-audit
Once you have installed adonis-audit, make sure to register the provider inside start/app.js
in order to make use of it.
const providers = ['@ks-labs/adonis-audit/providers/AuditProvider']
Add the following to your model's boot
method:
class MyModel extends Model {
static boot() {
super.boot()
this.addTrait('@provider:Auditable')
}
}
This you can start using as follows:
// create
const model = await MyModel.audit().create({ name: 'John' })
// update
const model = MyModel.find(1)
await model.audit().update({ name: 'Simon' })
// delete
const model = MyModel.find(1)
await model.audit().delete()
- AdonisJS - The web framework used.
SemVer is used for versioning. For the versions available, see the tags on this repository.
- KS Labs - Version Owner/Mantainer - kslabs
- Vinny - Mantainer - vinicioslc
- Simon Tong - Creator - simontong
This project is licensed under the MIT License - see the LICENSE file for details.