PHPackages                             gabrielrcosta1/laravel-schema - 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. gabrielrcosta1/laravel-schema

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

gabrielrcosta1/laravel-schema
=============================

Laravel package to generate migrations from a schema.db definition file.

v1.0.01(11mo ago)65MITPHPPHP ^8.2

Since Jun 8Pushed 11mo agoCompare

[ Source](https://github.com/gabrielrcosta1/laravel-schema)[ Packagist](https://packagist.org/packages/gabrielrcosta1/laravel-schema)[ RSS](/packages/gabrielrcosta1-laravel-schema/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Laravel Schema (Development Preview)
====================================

[](#laravel-schema-development-preview)

> 🧪 This package is currently under development. Features, APIs and behavior may change at any time.

Generate Laravel migration files based on a simple DSL (domain-specific language) written in a single file: `schema.db`.

---

📦 Installation
--------------

[](#-installation)

Then run:

```
composer require gabrielrcosta1/laravel-schema
```

---

📁 What It Does
--------------

[](#-what-it-does)

- Adds Artisan commands:
    - `schema:create`
    - `schema:migrate`
    - `schema:reset`
- Lets you define your database tables in a single DSL file
- Generates Laravel-compatible migration files into `database/migrations`
- Tracks schema changes and generates only incremental migrations
- Supports full or table-specific reset
- Lets you run `php artisan migrate` as usual

---

🚀 Usage
-------

[](#-usage)

### 1. Generate the schema file

[](#1-generate-the-schema-file)

```
php artisan schema:create
```

This will create the file:

```
/your-laravel-project/database/schema.db

```

With default content for:

- `posts`

---

### 2. Define your schema (example)

[](#2-define-your-schema-example)

Edit `database/schema.db` like this:

```
table posts {
    id primary
    title string
    body text
    published_at timestamp nullable
    user_id foreign:users.id
    timestamps
    softDeletes
}
```

---

### 3. Generate migration files

[](#3-generate-migration-files)

```
php artisan schema:migrate
```

This will:

- Parse `schema.db`
- Compare with previous schema
- Generate new migrations:
    - full table migrations
    - incremental `add_` / `remove_` migrations

---

### 4. Apply the migrations

[](#4-apply-the-migrations)

```
php artisan migrate
```

---

### 5. Reset generated migrations

[](#5-reset-generated-migrations)

If you want to delete generated migrations and schema cache:

#### Reset everything:

[](#reset-everything)

```
php artisan schema:reset --all
```

#### Reset only one table:

[](#reset-only-one-table)

```
php artisan schema:reset
# You will be prompted for the table name
```

This deletes:

- The migration files related to the selected table(s)
- The schema cache files (.json and .hash)

---

✅ Commands Summary
------------------

[](#-commands-summary)

CommandDescription`schema:create`Create `schema.db` with default tables`schema:migrate`Generate migrations from schema (full or incremental)`schema:reset`Delete generated migrations and cache (`--all` or specific)`php artisan migrate`Apply the generated migrations---

⚠️ Status
---------

[](#️-status)

This package is **in development**.
Use at your own risk in production environments.

Contributions, ideas, and issues are welcome.

---

📄 License
---------

[](#-license)

MIT — © Gabriel R. Costa

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance52

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

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

Unknown

Total

1

Last Release

339d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1bfc0ea91610a40a6a820f6674075855697f9ea9c657083154fd16e5c8a5c930?d=identicon)[gabrielrcosta1](/maintainers/gabrielrcosta1)

---

Top Contributors

[![gabrielrcosta1](https://avatars.githubusercontent.com/u/138326477?v=4)](https://github.com/gabrielrcosta1 "gabrielrcosta1 (8 commits)")

---

Tags

laravelschemadatabasegeneratormigrationsDSL

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/gabrielrcosta1-laravel-schema/health.svg)

```
[![Health](https://phpackages.com/badges/gabrielrcosta1-laravel-schema/health.svg)](https://phpackages.com/packages/gabrielrcosta1-laravel-schema)
```

###  Alternatives

[kitloong/laravel-migrations-generator

Generates Laravel Migrations from an existing database

2.9k7.4M24](/packages/kitloong-laravel-migrations-generator)[dragon-code/laravel-data-dumper

Adding data from certain tables when executing the `php artisan schema:dump` console command

3418.6k](/packages/dragon-code-laravel-data-dumper)[orptech/laravel-migration-partition

Laravel extensions that extends Illuminate to enable partitioned table creation within Laravel migrations.

3426.7k](/packages/orptech-laravel-migration-partition)

PHPackages © 2026

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