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 today

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 66% of packages

Maintenance41

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

488d 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.1k43.2M631](/packages/spatie-laravel-medialibrary)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M194](/packages/laravel-ai)[illuminate/queue

The Illuminate Queue package.

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

Automatic caching for Eloquent models.

2.4k91.0k1](/packages/mike-bronner-laravel-model-caching)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)

PHPackages © 2026

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