Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 498 Bytes

instructions.md

File metadata and controls

28 lines (20 loc) · 498 Bytes

Registering provider

Make sure to register the soft deletes provider inside start/app.js

const providers = [
  '@backspacerhino/adonis-soft-deletes/providers/SoftDeletesProvider'
]

Usage

Once done you can access register the trait as follows.

const Model = use('Model')

class Post extends Model {
  static boot () {
    super.boot()
    this.addTrait('@provider:SoftDeletes')
  }
}

DB Schema

Make sure that your models' table has deleted_at datetime column.