PHPackages                             yui019/hori - 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. yui019/hori

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

yui019/hori
===========

Database schema library for Laravel inspired by Prisma.

1.1.0(1y ago)5104↓100%[1 issues](https://github.com/yui019/hori/issues)PHPPHP ^8.0

Since Jun 17Pushed 1y ago1 watchersCompare

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

READMEChangelog (2)DependenciesVersions (3)Used By (0)

Hori
====

[](#hori)

Database schema library for Laravel inspired by [Prisma](https://www.prisma.io/).

How is this different from normal laravel migrations?
-----------------------------------------------------

[](#how-is-this-different-from-normal-laravel-migrations)

In case you've never used the NodeJS library [Prisma](https://www.prisma.io/), what it does is that it handles creating migrations for you. You have a single schema file where you write all the tables you have and migrations to add/drop tables or columns are automatically generated according to it.

So if you want to remove a column from a table, all you need to do is remove it in the schema file and run `php artisan hori:generate`, which automatically generates a migration that removes that column.

There's 2 advantages to this approach:

1. It's much easier and faster for you to directly work on a single schema file than to manually create migrations for each change
2. You don't need to look at all migrations or the database to know what tables and rows you currently have - you just look at the schema file instead

Usage
-----

[](#usage)

You can install Hori with the command:

```
composer require yui019/hori

```

After that, you run:

```
php artisan hori:install

```

which will create a `hori` directory in the `database` directory with a `schema.php` file inside.

This is what that file looks like by default:

```
