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 1w 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

30

—

LowBetter than 61% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

533d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/68889896?v=4)[MuhammadSyahmi98](/maintainers/MuhammadSyahmi98)[@MuhammadSyahmi98](https://github.com/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

[spatie/laravel-medialibrary

Associate files with Eloquent models

6.2k45.4M704](/packages/spatie-laravel-medialibrary)[laravel/ai

The official AI SDK for Laravel.

1.1k4.6M322](/packages/laravel-ai)[illuminate/queue

The Illuminate Queue package.

20433.0M1.8k](/packages/illuminate-queue)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k161.4k2](/packages/mike-bronner-laravel-model-caching)[forjedio/inertia-table

Backend-driven dynamic tables for Laravel + Inertia.js

272.0k](/packages/forjedio-inertia-table)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

265.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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