24

Oct 2019

Generating CRUD Module

Aurora CRUD provides 3 options when using the module for file generator, the options that will be provided is generate model, generate controller, and generate 3 files simultaneously in the form of model, controller, and route. users can use the command to generate Aurora CRUD module files.


Generate Model

Generate model is a command that has a function to make the model file in accordance with an existing table.

Run generate model by giving command on terminal:

Aurora model:create <_model_file_name> -t

Example :

Aurora model:create membersModel -t members

 


Generate Controller

Generate Controller is a command that has a function to make a controller file that already has a CRUD function that is ready to use. This generate can be used with two methods, namely through existing models or the method without generating models that produce a file with CRUD functions that are empty and can be customized by the user.

Run generate controller by giving command on terminal:

for creating controllers without model adjustment.

Aurora controller:create

for creating controllers with model adjustment.

Aurora controller:create <name_controller_file> -m <model_name> 

Example :

Aurora controller:create membersController -m membersModel

 


Generate Run (Model, Controller, Route)

Generate Run is a command that has functions to create models, controllers, and routes file through an existing table with functions that are ready to use.

Run generate run by giving command on terminal:

Aurora generate:run -t 

Example :

Aurora generate:run members -t members