Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 0 additions & 55 deletions .docs/README.md

This file was deleted.

64 changes: 54 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,74 @@
Website 🚀 <a href="https://contributte.org">contributte.org</a> | Contact 👨🏻‍💻 <a href="https://f3l1x.io">f3l1x.io</a> | Twitter 🐦 <a href="https://twitter.com/contributte">@contributte</a>
</p>

## Usage
Generate Nextras ORM entities from an existing database schema with configurable output for together or separated model layouts.

## Versions

| State | Version | Branch | PHP |
|-------------|---------|----------|----------|
| dev | `^0.7` | `master` | `>= 8.1` |
| stable | `^0.6` | `master` | `>= 8.1` |

## Installation

To install the latest version of `contributte/nextras-orm-generator` use [Composer](https://getcomposer.org).

```bash
composer require contributte/nextras-orm-generator
composer require --dev contributte/nextras-orm-generator
```

## Documentation
This script does not need to be part of your project, so you can install it anywhere you like and provide a path to the desired directory where entities will be generated.

For details on how to use this package, check out our [documentation](.docs).
## Usage

## Versions
### Generate All Entities Together

| State | Version | Branch | PHP |
|-------------|---------|----------|----------|
| dev | `^0.7` | `master` | `>= 8.1` |
| stable | `^0.6` | `master` | `>= 8.1` |
```php
$config = [
'output' => __DIR__ . '/model/together',
// Other options
];
$factory = new SimpleFactory(
new TogetherConfig($config),
new DatabaseAnalyser('mysql:host=127.0.0.1;dbname=nextras_orm_generator', 'root')
);

$factory->create()->generate();
```

### Generate Entities Separately

```php
$config = [
'output' => __DIR__ . '/model/separated',
// Other options
];
$factory = new SimpleFactory(
new SeparateConfig($config),
new DatabaseAnalyser('mysql:host=127.0.0.1;dbname=nextras_orm_generator', 'root')
);

$factory->create()->generate();
```

You can also see example in our playground at [contributte/playground](https://github.com/contributte/playground/tree/master/nextras-orm-generator).

To try the bundled SQLite example locally, run:

```bash
php examples/together.php
```

## Configuration

This tool is highly configurable. Take a look at [configuration classes](src/Config) for list of all available options.

## Development

See [how to contribute](https://contributte.org/contributing.html) to this package.

This package is currently maintaining by these authors.
This package is currently maintained by these authors.

<a href="https://github.com/f3l1x">
<img width="80" height="80" src="https://avatars2.githubusercontent.com/u/538058?v=3&s=80">
Expand Down