Download the PHP package mrcorex/laravel-model-generator without Composer
On this page you can find all versions of the php package mrcorex/laravel-model-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-model-generator
Model generator
Auto-generate models for a Laravel 5 project.
Note: it is recommended to abandon this package and use corex/lmodel instead. It is more up-to-date and uses doctrine/dbal instead of native sql + other advantages. There are a few changes in configuration but easy to convert config to corex/lmodel.
You can continue to use this package. I will do my best to support future versions.
Only MySQL will be supported.
Connects to your existing database and auto-generates models based on existing schema.
- Support for multiple dababases.
- Support for magic properties.
- Support for custom methods.
- Support for guarded fields.
- Support for "extends".
- Support for extra column-attributes after magic properties.
- Support for building constants in model.
- Support for multiple "uses".
- Support for custom "indent".
Installation
Run .
Add a configuration-file called corex and add following code to it. Modify it to suit your needs.
Settings:
- path - where models are saved.
- namespace - namespace of models.
- databaseSubDirectory - true/false if name of database-connection should be applied to namespace/directory. Name will automatically be converted to PascalCase.
- extends - (optional) class to extend instead of "Illuminate\Database\Eloquent\Model". Default ''.
- indent - (optional) String to use as indent i.e. "\t". Default 4 spaces.
- uses - (optional) List of use's. Warning: it does not clean up old uses, if you change "extends" after model initially was created.
- const - (optional) This section is used to specify connections and tables which should contains constants from content of table.
- {connection} - (optional) Name of connection.
- {table} - (optional) Name of table.
- {id} - (required) Name of field to get id from used in constant as value.
- {name} - (required) Name of field to get name of constant.
- {prefix} - (optional) Prefix to add to each name of constant.
- {suffix} - (optional) Suffix to add to each name of constant.
- replace - (optional) Values to replace in name of constant.
To register it and make sure you have this option available for development only, add following code to AppServiceProviders@register.
Help
Arguments:
- connection: Name of connection to generate models from. It will be added to namespace/path for separation of models. It is possible to disable this.
- tables: Comma separated table names to generate. Specify "." to generate all.
Options:
- guarded: Comma separated list of guarded fields.