PHPackages                             mll-lab/laravel-utils - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. mll-lab/laravel-utils

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mll-lab/laravel-utils
=====================

Shared Laravel utilities of MLL

v10.11.0(2mo ago)6185.2k↓37.8%3[3 PRs](https://github.com/mll-lab/laravel-utils/pulls)MITPHPPHP ^8.2CI passing

Since Dec 7Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/mll-lab/laravel-utils)[ Packagist](https://packagist.org/packages/mll-lab/laravel-utils)[ Docs](https://github.com/mll-lab/laravel-utils)[ RSS](/packages/mll-lab-laravel-utils/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (46)Versions (50)Used By (0)

laravel-utils
=============

[](#laravel-utils)

[![Validate](https://github.com/mll-lab/laravel-utils/actions/workflows/validate.yml/badge.svg)](https://github.com/mll-lab/laravel-utils/actions)[![Code Coverage](https://camo.githubusercontent.com/461ee72b490b03d4a08504a2b00e217b0ad70a978532e0e965b648b8f485bc35/68747470733a2f2f636f6465636f762e696f2f67682f6d6c6c2d6c61622f6c61726176656c2d7574696c732f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/mll-lab/laravel-utils)

[![Latest Stable Version](https://camo.githubusercontent.com/84778ee17c1eb17664b2c9eb94ad3495aed89ba3aec9e1c6806d9e24b96ea944/68747470733a2f2f706f7365722e707567782e6f72672f6d6c6c2d6c61622f6c61726176656c2d7574696c732f762f737461626c65)](https://packagist.org/packages/mll-lab/laravel-utils)[![Total Downloads](https://camo.githubusercontent.com/6d0874a9770ef5c550659f8982ad2936b4af99d04863420ce92ca83052de4d4c/68747470733a2f2f706f7365722e707567782e6f72672f6d6c6c2d6c61622f6c61726176656c2d7574696c732f646f776e6c6f616473)](https://packagist.org/packages/mll-lab/laravel-utils)

Shared Laravel utilities of MLL

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

[](#installation)

Install through composer

```
composer require mll-lab/laravel-utils
```

Usage
-----

[](#usage)

See [tests](tests).

### Autoincrement

[](#autoincrement)

Allows the creation of incrementing IDs without actually using autoincrement.

Extend the class [`Autoincrement`](src/Database/Autoincrement.php) with a descriptive name for your ID.

```
use MLL\LaravelUtils\Database\Autoincrement;

final class MaxFooID extends Autoincrement
{
    public static function name(): string
    {
        return 'max_foo_id';
    }
}
```

Generate a migration and call the `createTable()` method in it:

```
public function up(): void
{
    MaxFooID::createTable();
}
```

To use this ID in your model, set `$incrementing` to false and assign the ID to your model in the `booted()` method:

```
public $incrementing = false;

protected static function booted(): void
{
    self::creating(function (self $instance): void {
        $instance->id ??= MaxFooID::next();
    });
```

### Conditional Migrations

[](#conditional-migrations)

To run a migration conditionally, implement the `MLL\LaravelUtils\Database\ConditionalMigration`interface and its `->shouldRun()` method in your migration:

```
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Carbon;
use MLL\LaravelUtils\Database\ConditionalMigration

return new class extends Migration implements ConditionalMigration {
    public function up(): void
    {
        // Something that would put intense strain on the database
    }

    public function shouldRun(): bool
    {
        $currentHour = Carbon::now()->hour;

        // Only run between 01:00 and 03:00
        return $currentHour > 1 && $currentHour < 3;
    }
};
```

### Strict Stubs

[](#strict-stubs)

To continually keep your stubs updated with the latest and greatest from this package, add `/stubs` to your `.gitignore` and add the following to your `composer.json`:

```
    "scripts": {
        "post-update-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postUpdate",
+           "@php artisan vendor:publish --tag=strict-stubs --force"
        ]
    }
```

Changelog
---------

[](#changelog)

See [`CHANGELOG.md`](CHANGELOG.md).

Contributing
------------

[](#contributing)

See [`CONTRIBUTING.md`](.github/CONTRIBUTING.md).

License
-------

[](#license)

This package is licensed using the MIT License.

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance86

Actively maintained with recent releases

Popularity38

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 84.8% 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 ~26 days

Recently: every ~56 days

Total

46

Last Release

80d ago

Major Versions

v5.8.0 → v6.0.02024-09-17

v6.0.0 → v7.0.02024-11-11

v7.0.0 → v8.0.02024-11-19

v8.0.1 → v9.0.02024-11-27

v9.0.0 → v10.0.02025-02-25

PHP version history (3 changes)v1.0.0PHP ^7.4 || ^8

v2.0.0PHP ^8.1

v9.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/2ff5d1af2c0f601f7ed7e75e15be0aa4c062149b57fd5aace4e44cc37b8b7a40?d=identicon)[spawnia](/maintainers/spawnia)

![](https://www.gravatar.com/avatar/8bc431e479f402ddb0f2a7d1a35a2e812ab5565b8f5eb78d5c43263984e1cf3c?d=identicon)[SimBig](/maintainers/SimBig)

---

Top Contributors

[![spawnia](https://avatars.githubusercontent.com/u/12158000?v=4)](https://github.com/spawnia "spawnia (67 commits)")[![simbig](https://avatars.githubusercontent.com/u/26680884?v=4)](https://github.com/simbig "simbig (7 commits)")[![mwikberg-virta](https://avatars.githubusercontent.com/u/130439907?v=4)](https://github.com/mwikberg-virta "mwikberg-virta (2 commits)")[![fischerl](https://avatars.githubusercontent.com/u/12935231?v=4)](https://github.com/fischerl "fischerl (1 commits)")[![shakaran](https://avatars.githubusercontent.com/u/14254?v=4)](https://github.com/shakaran "shakaran (1 commits)")[![sp3259](https://avatars.githubusercontent.com/u/41192240?v=4)](https://github.com/sp3259 "sp3259 (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mll-lab-laravel-utils/health.svg)

```
[![Health](https://phpackages.com/badges/mll-lab-laravel-utils/health.svg)](https://phpackages.com/packages/mll-lab-laravel-utils)
```

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[illuminate/pipeline

The Illuminate Pipeline package.

9346.6M213](/packages/illuminate-pipeline)[firefly-iii/data-importer

Firefly III Data Import Tool.

7545.8k](/packages/firefly-iii-data-importer)[mrmarchone/laravel-auto-crud

Laravel Auto CRUD helps you streamline development and save time.

28711.8k2](/packages/mrmarchone-laravel-auto-crud)[tehwave/laravel-achievements

Simple, elegant Achievements the Laravel way

7012.8k](/packages/tehwave-laravel-achievements)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)

PHPackages © 2026

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