Download the PHP package pursehouse/modeler-laravel-eloquent without Composer
On this page you can find all versions of the php package pursehouse/modeler-laravel-eloquent. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pursehouse/modeler-laravel-eloquent
More information about pursehouse/modeler-laravel-eloquent
Files in pursehouse/modeler-laravel-eloquent
Package modeler-laravel-eloquent
Short Description Generate model classes for Eloquent in Laravel
License MIT
Homepage https://github.com/pursehouse
Informations about the package modeler-laravel-eloquent
Pursehouse Modeler for Eloquent/Laravel
Generate model classes for Eloquent in Laravel
How does it work?
This package expects that you are using Laravel 5.1 or above.
You will need to import the pursehouse/modeler-laravel-eloquent
package via composer:
Configuration
Add the service provider to your config/app.php
file within the providers
key:
Configuration for local environment only
If you wish to enable generators only for your local environment, 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 :-)
Origins
Originally forked from Reliese/larvel
project
All versions of modeler-laravel-eloquent with dependencies
doctrine/dbal Version >=2.5
illuminate/support Version >=5.1
illuminate/database Version >=5.1
illuminate/contracts Version >=5.1
illuminate/filesystem Version >=5.1
illuminate/console Version >=5.1