Skip to main content

Model generating

node op make:model <modelname> [options]

Options:

  • -c, --controller Genarate controller file
  • -m, --migration Generate migration file
  • -s, --seeder Generate seeder file
  • -t, --test Generate test file
  • --modrel Generate modrels content
  • -r, --router Generate router for api.js
  • -a, --all Generate all files and content

For example

The model name is written in lowercase, singular.

node op make:model employee

By generating all the resource files:

node op make:model employee -a

Model generation with controller:

node op make:model employee -c

Model generation with controller and routing:

node op make:model employee -c -r

Specifying the plural

If a name is entered in a language other than English, it may be necessary to enter the plural.

node op make:model alma almak
node op make:model alma almak -a