Download the PHP package laracademy/model-generator without Composer
On this page you can find all versions of the php package laracademy/model-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download laracademy/model-generator
More information about laracademy/model-generator
Files in laracademy/model-generator
Package model-generator
Short Description This package will generate a Laravel Model based on your database table itself, filling in the required fields automatically.
License MIT
Informations about the package model-generator
Model Generator
PLEASE NOTE THAT THIS PACKAGE IS NOW MOVED INTO https://packagist.org/packages/laracademy/generators
Model Generator - Will read your current table structure and generate a model will the filled in fields automatically.
You can generate a single table model, or multiple at once.
Author(s):
Requirements
- PHP 5.6+
- Laravel 5.2+
Usage
Step 1: Install through Composer
Step 2: Add the Service Provider
The easiest method is to add the following into your config/app.php
file
Depending on your set up you may want to only use these providers for development, so you don't update your production
servers. Instead, add the provider in `app/Providers/AppServiceProvider.php' like so
Artisan
Now that we have added the generator to our project the last thing to do is run Laravel's Arisan command
You will see the following in the list
The command comes with a bunch of different options and they are listed below
- --table=
- this can either be a single table, or a list of tables separated by a comma
- --all
- this will ignore any tables that you have added and generate a full list of tables within your database to generate models for
- please note that this command will only ignore the
migrations
table and no model will be generate for it
- --connection= *
- --debug
- this shows some more information while running
Examples
Generating a single table
Generating a multiple tables
Generating all tables
Changing to another connection found in database.php
and generating models for all tables
License
ModelGen is open-sourced software licensed under the MIT license
Bug Reporting and Feature Requests
Please add as many details as possible regarding submission of issues and feature requests
Disclaimer
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.