Download the PHP package sasanet/eloquent-model-generator without Composer
On this page you can find all versions of the php package sasanet/eloquent-model-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sasanet/eloquent-model-generator
More information about sasanet/eloquent-model-generator
Files in sasanet/eloquent-model-generator
Package eloquent-model-generator
Short Description Fork of Reliese Components for Laravel Framework eloquent code generation with sql server.
License MIT
Homepage http://cristianllanos.com
Informations about the package eloquent-model-generator
Reliese Laravel
Reliese Laravel is a collection of Laravel Components which aim is to help the development process of Laravel applications by providing some convenient code-generation capabilities.
How does it work?
This package expects that you are using Laravel 5.1 or above.
You will need to import the reliese/laravel
package via composer:
Configuration
It is recommended that this package should only be used on a local environment for security reasons. You should install it via composer using the --dev option like this:
Then you'll need to register the provider in app/Providers/AppServiceProvider.php
file.
Models
Add the models.php
configuration file to your config
directory and clear the config cache:
Usage
Assuming you have already configured your database, you are now all set to go.
-
Let's scaffold some of your models from your default connection.
-
You can scaffold a specific table like this:
-
You can also specify the connection:
- If you are using a MySQL database, you can specify which schema you want to scaffold:
Customizing Model Scaffolding
To change the scaffolding behaviour you can make config/models.php
configuration file
fit your database needs. Check it out ;-)
Tips
1. Keeping model changes
You may want to generate your models as often as you change your database. In order
not to lose you own model changes, you should set base_files
to true
in your config/models.php
.
When you enable this feature your models will inherit their base configurations from base models. You should avoid adding code to your base models, since you will lose all changes when they are generated again.
Note: You will end up with two models for the same table and you may think it is a horrible idea to have two classes for the same thing. However, it is up to you to decide whether this approach gives value to your project :-)
Support
For the time being, this package supports MySQL, PostgreSQL and SQLite databases. Support for other databases are encouraged to be added through pull requests.
All versions of eloquent-model-generator with dependencies
doctrine/dbal Version ^2.7
illuminate/support Version ^5.8
illuminate/database Version ^5.8
illuminate/contracts Version ^5.8
illuminate/filesystem Version ^5.8
illuminate/console Version ^5.8