Generate Model

apex opus model <FILENAME> --dbtable= <TABLE> [--magic] [--doctrine] [--eloquent]
Generate a new model class.

Parameters

Parameter Description
filename File location of the new model class, relative to the /src/ directory.

Flags

Flag Description
--dbtable The name of the database table to use to generate property names. Not required if generating Eloquent model.
--magic If present, will generate model without hard coded get / set methods and instead allow properties to be accessed directly. . Otherwise, will generate model with hard coded get / set methods.
--doctrine If present, will generate a Doctrine entity class for given database table.
--eloquent If present, will generate an Eloquent model class.

Examples

  • ./apex opus MyShop/Models/Products --dbtable shop_products --magic
  • ./apex opus model MyShop/Models/ShopOrder --eloquent