This is the fullstack boilerplate for AdonisJs, it comes pre-configured with.
- Bodyparser
- Session
- Authentication
- Web security middleware
- CORS
- Edge template engine
- Lucid ORM
- Migrations and seeds
Use the adonis command to install the blueprint
adonis new yardstick
or manually clone the repo and then run npm install
.
- getTable show table name
User.getTable() /* tb_user */
- getPrimary show Primary name
User.getPrimary() /* id */
- getConnent show is getConnent
User.getConnent() /* mysql */
- nextId show next id auto_increment
User.nextId()
- columnList show column list
User.columnList() /* full */ User.columnList('key') /* column name */
use Helpers
const Helpers = use('Help');
- encrypt encryption format laravel
Helpers.encrypt('1234')
- decrypt decryption format laravel
Helpers.decrypt('1234')
- empty check value
Helpers.empty(null) /* false */
- range number
Helpers.range(0,10) /* [0,1,2,3,..,10] */ Helpers.range(0,10,2) /* [0,2,4,..,10] */
- strLimit Limit by string
Helpers.strLimit('This string is really really long.', 7) /* This st... */ Helpers.strLimit('This string is really really long.', 7, '»') /* This st» */
- callBack data function
Helpers.callBack('App/Controllers/Http/UserController'/* path file */,'show'/* function */,[{request, response}]/* paramiter */)
- convertDate convert format datetime
Helpers.convertDate('Thursday, February 6th, 2014 9:20pm','YYYY-M-D h:mm:ss') /* 2014-2-6 9:20:00 */ Helpers.convertDate('Thursday, February 6th, 2014 9:20pm','YYYY-MM-DD h:mm:ss') /* 2014-02-06 9:20:00 */