ernestovargas/laranerators

Laravel 5 generators from existing schema

dev-master 2015-11-24 23:44 UTC

This package is not auto-updated.

Last update: 2024-11-23 19:00:37 UTC


README

[Build Status] (https://travis-ci.org/ernestova/laranerators.svg) SensioLabsInsight

Model generator

Laravel 5 model generator for an existing MySql schema.

It reads your existing database schema and generates model class files based on the existing tables.

Installation

Add "ernestovargas/laranerators": "dev-master" to your require-dev section on your composer.json file.

Because the generators are only useful for development, add the provider in app/Providers/AppServiceProvider.php, like:

public function register()
{
    if ($this->app->environment() == 'local') {
        $this->app->register('ErnestoVargas\Generators\GeneratorsProvider');
    }
}

Help & Options

php artisan help make:models

Options:

  • --dir="" Model directory (default: "Models/")
  • --extends="" Parent class (default: "Model")
  • --fillable="" Rules for $fillable array columns (default: "")
  • --guarded="" Rules for $guarded array columns (default: "ends:_id|ids,equals:id")
  • --timestamps="" Rules for $timestamps columns (default: "ends:_at")
  • --ignore=""|-i="" A table names to ignore
  • --ignoresystem|-s List of system tables (auth, migrations, entrust package)