This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
** You only need to put this file inside your Traits | |
** Feel free to contribute | |
** to call it in your models just put this.addTrait('Uuid'); | |
** if you want to create the trait with options, | |
** just pass the uuid properties array: this.addTrait('Uuid', ['field']); | |
** each position in the array refers to a key with uuid format inside your model | |
** another way is creating a get function, e.g: get uuidFields() { return ['field1', 'field 2']; } | |
**/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { ServiceProvider } = require('@adonisjs/fold') | |
class PhoneProvider extends ServiceProvider { | |
async phone(data, field, message, args, get){ | |
const value = get(data, field); | |
if (!value) { | |
return | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { ServiceProvider } = require('@adonisjs/fold') | |
class LatitudeProvider extends ServiceProvider { | |
async lat(data, field, message, args, get){ | |
const value = get(data, field); | |
if (!value) { | |
return | |
} |