Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

adonis prepare create

import User from 'App/Models/User'
const user = new User()

// Assign username and email
user.username = 'virk'
user.email = 'virk@adonisjs.com'

// Insert to the database
await user.save()

console.log(user.$isPersisted) // true
Source by docs.adonisjs.com #
 
PREVIOUS NEXT
Tagged: #adonis #prepare #create
ADD COMMENT
Topic
Name
8+3 =