If "make" command was a superhero.
npm i @weskerjs/supergen
- Add
"@weskerjs/supergen/build/commands"
to the commands array in.adonisrc.json
- Run
node ace generate:manifest
node ace supergen --name cars --fields=manufacturer:string,model:string,colour:string
This will generate the following:
- Create, Show, Edit and List views inside
views/cars
directory - CarsController
- Car model
- [timestamp]_cars.ts migration.
It will also append CRUD routes to the end of start/routes.ts
Ensure the resource name is in lowercase or you'll run into some issues in the Controller file.