PHPackages                             flipbox/orm-manager - 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. flipbox/orm-manager

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

flipbox/orm-manager
===================

Laravel ORM mangaer

v1.0.0(9y ago)14731MITPHPPHP &gt;=5.6.4

Since Mar 5Pushed 9y ago4 watchersCompare

[ Source](https://github.com/flipboxstudio/orm-manager)[ Packagist](https://packagist.org/packages/flipbox/orm-manager)[ RSS](/packages/flipbox-orm-manager/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (5)Versions (5)Used By (0)

Laravel ORM Manager
===================

[](#laravel-orm-manager)

[![Total Downloads](https://camo.githubusercontent.com/3daacc134ed8079ac6f3629c253a211421cd8249a487255b2d549f8a38834bba/68747470733a2f2f706f7365722e707567782e6f72672f666c6970626f782f6f726d2d6d616e616765722f642f746f74616c2e737667)](https://packagist.org/packages/flipbox/orm-manager)[![Latest Stable Version](https://camo.githubusercontent.com/bd50142d6f190819621480781d3b13f3c8ab88c77850a13d9d8cb697a04e6fc6/68747470733a2f2f706f7365722e707567782e6f72672f666c6970626f782f6f726d2d6d616e616765722f762f737461626c652e737667)](https://packagist.org/packages/flipbox/orm-manager)[![Latest Unstable Version](https://camo.githubusercontent.com/60b660353ec6f64bc14e72b395636c5913d1f5a9d0ba97a1402326fcf88f7bed/68747470733a2f2f706f7365722e707567782e6f72672f666c6970626f782f6f726d2d6d616e616765722f762f756e737461626c652e737667)](https://packagist.org/packages/flipbox/orm-manager)[![License](https://camo.githubusercontent.com/3123934c9adebf8bac470ae45ca47d6822c630f21010acbb5b046c2f693bb905/68747470733a2f2f706f7365722e707567782e6f72672f666c6970626f782f6f726d2d6d616e616765722f6c6963656e73652e737667)](https://packagist.org/packages/flipbox/orm-manager)

This package is manager for laravel or lumen ORM (object relational mapping) Model. You can generate relation method and control Model development in your project. **Relation method** is method in Model class that reference to another Model for get data in related Model. For example you have a model **User** and **Phone** with relation one to one. Both model will be called connected if there is relation method in both class. In class User.php there should be

```
class User extends Authenticatable
{
    /**
     * Get the phone record associated with the user.
     */
    public function phone()
    {
        return $this->hasOne(Phone::class);
    }
}
```

In class Phone.php

```
class Phone extends Model
{
    /**
     * Get the user that owns the phone
     */
    public function user()
    {
        return $this->belongsTo(User::class);
    }
}
```

When you are working with very large projects, you might feel more difficult to connect all models in your project. This package can be auto generate all relation method of your project's model, even relation method that you don't need right now. And with this package we hope development relation method of Models faster and easier.

Install
-------

[](#install)

require with composer:

```
composer require flipbox/orm-manager

```

Add service provider for Laravel in the file `config/app.php`

```
Flipbox\OrmManager\OrmManagerServiceProvider::class,

```

Add service provider for Lumen in the file `bootstrap/app.php`

```
$app->register(Flipbox\OrmManager\OrmManagerServiceProvider::class);

```

Features
--------

[](#features)

See `php artisan` in console, if you install this package correctly you will see list of features with prefix `orm:`

### Control ORM Model

[](#control-orm-model)

#### List of Model

[](#list-of-model)

Type `php artisan orm:list` in console, that will show you list of your project model and its properties. for example: [![ScreenShot](https://raw.githubusercontent.com/flipboxstudio/orm-manager/develop/screenshoots/list.png)](https://raw.githubusercontent.com/flipboxstudio/orm-manager/develop/screenshoots/list.png)

#### Detail of Model

[](#detail-of-model)

Type `php artisan orm:detail User` in console, that will show you detail of selected Model. for example: [![ScreenShot](https://raw.githubusercontent.com/flipboxstudio/orm-manager/develop/screenshoots/detail.png)](https://raw.githubusercontent.com/flipboxstudio/orm-manager/develop/screenshoots/detail.png)

### Generate Relation Method

[](#generate-relation-method)

**How it works?** Generator it first check the database connection of your project, if you has been created the database and its connected, it will check required option of relation in the database schema such as `primary key`, `foreign key`, `pivot table`, etc. And if you hasn't yet create database or its not connected, it will offer some required options of relation. And after required option is fulfilled it will check is method exists in the method, than will create method in the model if hasn't.

#### Generate relation method in single Model

[](#generate-relation-method-in-single-model)

```
php artisan orm:connect User hasMany Phone
```

It will generate method in class Model User

- first argument is Model where method will be created
- second is relation name such as `hsaOne`, `hasMany`, `belongsTo`, `belongsToMany`, etc.
- third is reference Model.

#### Generate relation method in both Model

[](#generate-relation-method-in-both-model)

```
php artisan orm:both-connect User oneToMany Phone
```

It will generate method in class Model User and Phone

- first argument is first Model
- second is both-relation name such as `oneToOne`, `oneToMany`, `manyToMany`, `morphOneToOne`, etc.
- third is second Model.

#### Auto Generate All Models

[](#auto-generate-all-models)

important \*) it only work if you has been created database and project is connected.

```
php artisan orm:auto-connect
```

it will search possible connection between two models or more, and generate method to each model, sometime need your approval to decide relation type.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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 ~3 days

Total

3

Last Release

3398d ago

Major Versions

v0.0.2-beta → v1.0.02017-03-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/5585ab7e83e92b16ebfde64d7d90ff330721bcb1fbfa193fb0ffe149a4b3a7d1?d=identicon)[krisanalfa](/maintainers/krisanalfa)

![](https://avatars.githubusercontent.com/u/13754292?v=4)[Flipbox](/maintainers/flipbox)[@flipbox](https://github.com/flipbox)

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

---

Top Contributors

[![denmasyarikin](https://avatars.githubusercontent.com/u/18554343?v=4)](https://github.com/denmasyarikin "denmasyarikin (11 commits)")

---

Tags

generatorlaravelorm

### Embed Badge

![Health badge](/badges/flipbox-orm-manager/health.svg)

```
[![Health](https://phpackages.com/badges/flipbox-orm-manager/health.svg)](https://phpackages.com/packages/flipbox-orm-manager)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M337](/packages/psalm-plugin-laravel)[spatie/laravel-medialibrary

Associate files with Eloquent models

6.1k43.2M611](/packages/spatie-laravel-medialibrary)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M125](/packages/laravel-pulse)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M169](/packages/laravel-ai)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M123](/packages/roots-acorn)[illuminate/queue

The Illuminate Queue package.

21332.6M1.5k](/packages/illuminate-queue)

PHPackages © 2026

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