azizoff/laravel-model-generator

There is no license information available for the latest version (dev-master) of this package.

Laravel database based Laravel model generator

dev-master 2020-04-28 05:52 UTC

This package is auto-updated.

Last update: 2020-09-28 06:43:31 UTC


README

About

Creates a new model class based on a database table
!!! It works only with postgresql database.

Installation

Insert Azizoff\ModelGenerator\ModelGeneratorProvider::class into "providers" section of /config/app.php

or paste into AppServiceProvider::register()

if ($this->app->environment() === 'local'
        && class_exists(\Azizoff\ModelGenerator\ModelGeneratorProvider::class)
) {
        $this->app->register(\Azizoff\ModelGenerator\ModelGeneratorProvider::class);
}

Config

You can also publish the config file

php artisan vendor:publish --provider="Azizoff\\ModelGenerator\\ModelGeneratorProvider" --tag=config

Command

php artisan model:generate <tablename>
php artisan model:generate <tablename> --model=\\Http\\Models\\CustomModelName