Sign inSign up

104corp/eloquent-generator

By 104corp

•Updated over 6 years ago

Laravel Eloquent Generator

Image
0

1.4K

104corp/eloquent-generator repository overview

⁠Laravel Eloquent Generator

Build Status GitHub Release codecov

⁠System Requirement

⁠Support Database

  • MySQL
  • SQLite
  • PostgreSQL

⁠Installation

Download the Release⁠ phar file and execute it:

chmod +x eloquent-generator.phar
./eloquent-generator.phar

Or move into /usr/local/bin:

mv eloquent-generator.phar /usr/local/bin/eloquent-generator
eloquent-generator

⁠Usage

In the Laravel project, you can run this command directly:

cd /path/to/your-laravel-project
eloquent-generator

It's will generate model code into build directory, use the --output-dir option can change output dir. If want to change namespace, use the --namespace option.

In the other framework but using Eloquent ORM library, you must provide config file like laravel project.

This command using hassankhan/config⁠ to load config file like PHP, JSON, YAML, etc. Use --config-file option to specify custom config.

If only want build one connection, use the --connection option to specify.

Use the --overwrite option if you want to overwrite exist code.

⁠Using Docker

See the info about Docker at DockerHub⁠.

Just like using phar, you can run this command in the Laravel project:

cd /path/to/your-laravel-project
docker run -it --rm -v `pwd`:/source 104corp/eloquent-generator

Or set the alias will more like phar:

alias eloquent-generator='docker run -it --rm -v $PWD:/source 104corp/eloquent-generator'
eloquent-generator

See more info about option at Usage⁠ section.

⁠Build Yourself

Clone this repository and execute command:

make

The make command will generate eloquent-generator.phar file which is executable. You can execute this file or move into /usr/local/bin:

sudo mv eloquent-generator.phar /usr/local/bin/eloquent-generator
eloquent-generator

Tag summary

Content type

Image

Digest

Size

31.1 MB

Last updated

over 6 years ago

docker pull 104corp/eloquent-generator