PHPackages                             syahmi-jalil/database-to-model - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. syahmi-jalil/database-to-model

ActiveLibrary[Database &amp; ORM](/categories/database)

syahmi-jalil/database-to-model
==============================

Laravel package to generate models and migrations from existing database structure

v1.1.0(1y ago)018MITPHPPHP ^8.0|^8.1|^8.2|^8.3

Since Feb 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/MuhammadSyahmi98/migration-eloquent-generator)[ Packagist](https://packagist.org/packages/syahmi-jalil/database-to-model)[ RSS](/packages/syahmi-jalil-database-to-model/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (9)Used By (0)

Database to Model
=================

[](#database-to-model)

A Laravel package to generate models and migrations from existing database structure. This package allows you to reverse engineer your database into Laravel models and migrations, making it easier to work with existing databases or to create a backup of your database structure.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require syahmi-jalil/database-to-model
```

The package will automatically register its service provider.

Configuration
-------------

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --tag=database-to-model-config
```

This will create a `config/database-to-model.php` file where you can configure:

- Tables to ignore when generating models and migrations
- Default paths for generated files
- Maximum number of columns per migration file

Usage
-----

[](#usage)

Generate models and migrations for all tables:

```
php artisan generate:models-migrations
```

### Available Options

[](#available-options)

- `--tables`: Specific tables to generate (comma-separated)
- `--connection`: Database connection to use (defaults to your default connection)

### Examples

[](#examples)

Generate for specific tables:

```
php artisan generate:models-migrations --tables=users,products,orders
```

Use a different database connection:

```
php artisan generate:models-migrations --connection=mysql
```

Features
--------

[](#features)

- Automatically generates models with proper relationships
- Creates migrations that match your existing database structure
- Handles foreign key constraints properly
- Sorts tables by dependencies to ensure proper migration order
- Customizable through configuration

Requirements
------------

[](#requirements)

- PHP ^8.0
- Laravel ^9.0|^10.0|^11.0

Author
------

[](#author)

- [Syahmi Jalil](mailto:syahmijalil.my@gmail.com)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance44

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

8

Last Release

435d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f98737ab174ede544b0e2b5541c3e873c703d367e206e8c2de2b3a1d5c7af860?d=identicon)[MuhammadSyahmi98](/maintainers/MuhammadSyahmi98)

---

Top Contributors

[![MuhammadSyahmi98](https://avatars.githubusercontent.com/u/68889896?v=4)](https://github.com/MuhammadSyahmi98 "MuhammadSyahmi98 (17 commits)")

### Embed Badge

![Health badge](/badges/syahmi-jalil-database-to-model/health.svg)

```
[![Health](https://phpackages.com/badges/syahmi-jalil-database-to-model/health.svg)](https://phpackages.com/packages/syahmi-jalil-database-to-model)
```

###  Alternatives

[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[ryangjchandler/orbit

A flat-file database driver for Eloquent.

922256.2k5](/packages/ryangjchandler-orbit)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[baril/bonsai

An implementation of the Closure Tables pattern for Eloquent.

3593.5k](/packages/baril-bonsai)[toponepercent/baum

Baum is an implementation of the Nested Set pattern for Eloquent models.

3154.7k](/packages/toponepercent-baum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
