The Nartisan Command Line Interface (CLI) Frequently Asked Question
Create a new project from boilerplate replace NAME
argument with your project name. Used for package.json.
$ nartisan init NAME
Simply run nartisan serve with either --dev
or --prod
. Defaults to : --dev
$ nartisan serve || nartisan run | nartisan start --dev
Specify route with --model
argument and then enter the model which you want a route for, it automatically creates a new api controller for the model too.
$ nartisan route:create --model Profile
Specify controller with --model
argument and then enter the model which you want a controller for.
$ nartisan controller:create --model Avatar
Specify model name with --name
argument. List of table fields can be passed with --attributes
option
$ nartisan model:create --name Profile --attributes "name:[type:string],email:[type:string, unique:true]"
Specify associations with --associations
argument with following syntax: :,
$ nartisan model:create --name Profile --attributes .. --associations belongsTo:User,hasOne:Avatar
Specify migration name with --name
argument
$ nartisan migration:create --name <migration_name>
$ nartisan db:migrate
$ nartisan db:migrate:undo:all
Specify seeder name with --name
argument
$ nartisan seed:create --name <seeder_name>
$ nartisan db:seed:all
$ nartisan db:seed:undo:all