PHPackages                             bfg/bless\_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. bfg/bless\_model

ActiveBfg-app[Database &amp; ORM](/categories/database)

bfg/bless\_model
================

Recursive auto save eloquent Models

1.0.0(1y ago)18711MITPHPPHP ^8.0

Since Jul 11Pushed 1y ago2 watchersCompare

[ Source](https://github.com/bfg-s/bless_model)[ Packagist](https://packagist.org/packages/bfg/bless_model)[ Docs](https://github.com/bfg/bless_model)[ RSS](/packages/bfg-bless-model/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependencies (3)Versions (6)Used By (1)

BlessModel
==========

[](#blessmodel)

The purpose of this package is to save, update, delete, force delete, and restore data using a recursive array. It understands both an associative array for working with one record, and with a dataset for working with several records at once.

Installation
------------

[](#installation)

You can install the library using composer:

```
composer require bfg/bless_model
```

Beginning of work
-----------------

[](#beginning-of-work)

First, you need to design your models and their relationships.

How to use
----------

[](#how-to-use)

For convenience, the main method has been brought into the alias `BlessModel`. All you need to do is call the `do` method.

```
\BlessModel::do(\App\Models\User::class, []);
```

Let's imagine that our user model has the following relationships:

### profile - hasOne

[](#profile---hasone)

```
class Profile extends \Illuminate\Database\Eloquent\Model {

    protected $fillable = ["first_name","last_name","age","about"];
}
```

### roles - belongsToMany

[](#roles---belongstomany)

```
class Role extends \Illuminate\Database\Eloquent\Model {

    protected $fillable = ["slug","name"];
}
```

### posts - hasMany

[](#posts---hasmany)

```
class Post extends \Illuminate\Database\Eloquent\Model {

    protected $fillable = ["subject","text"];
}
```

### commentaries - morphMany

[](#commentaries---morphmany)

```
class Commentary extends \Illuminate\Database\Eloquent\Model {

    protected $fillable = ["text"];
}
```

And in order to fill in this data, you need to do the following:

```
\BlessModel::do(\App\Models\User::class, [
    "name" => "DoctorWho",
    "email" => "user@test.com",
    "profile" => [
        "first_name" => "Doctor",
        "last_name" => "Who",
        "age" => 2200,
        "about" => "An eccentric alien traveler of a great mind who fights injustice."
    ],
    "role" => [
        "slug" => "time_lord",
        "name" => "Time Lord",
    ],
    "posts" => [
        [
            "subject" => "About TARDIS",
            "text" => "The TARDIS (Time And Relative Dimension In Space) is a time machine and spacecraft that appears in the British science fiction television series Doctor Who and its various spin-offs."
        ]
    ],
    "commentaries" => [
        [
            "text" => "Butterflies are cool!"
        ],
        [
            "text" => "Yowzah!"
        ],
        [
            "text" => "Geronimo!"
        ]
    ]
]);
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity60

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

Total

5

Last Release

531d ago

Major Versions

0.1.0 → 1.0.02024-12-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/59b2d162a30938ac2c3c56340ebea07a6778a3e1c86cb70b5bc28b69a1c3f04d?d=identicon)[bfg](/maintainers/bfg)

---

Top Contributors

[![Xsaven](https://avatars.githubusercontent.com/u/1726771?v=4)](https://github.com/Xsaven "Xsaven (13 commits)")

---

Tags

laravelmodeleloquentmodelssaveupdaterecursivebfg

### Embed Badge

![Health badge](/badges/bfg-bless-model/health.svg)

```
[![Health](https://phpackages.com/badges/bfg-bless-model/health.svg)](https://phpackages.com/packages/bfg-bless-model)
```

###  Alternatives

[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[lacodix/laravel-model-filter

A Laravel package to filter, search and sort models with ease while fetching from database.

17649.9k](/packages/lacodix-laravel-model-filter)[pursehouse/modeler-laravel-eloquent

Generate model classes for Eloquent in Laravel

112.4k](/packages/pursehouse-modeler-laravel-eloquent)

PHPackages © 2026

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