PHPackages                             transprime-research/laravel-chained - 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. transprime-research/laravel-chained

ActiveLibrary

transprime-research/laravel-chained
===================================

PHP Laravel-Chained

1.0.0(4y ago)14MITPHPPHP &gt;=7.2

Since Oct 24Pushed 4y ago1 watchersCompare

[ Source](https://github.com/transprime-research/laravel-chained)[ Packagist](https://packagist.org/packages/transprime-research/laravel-chained)[ Docs](https://transprime-research.github.io/laravel-chained/)[ RSS](/packages/transprime-research-laravel-chained/feed)WikiDiscussions master Synced today

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

[![](https://github.com/transprime-research/assets/raw/master/laravel-chained/twitter_header_photo_2.png)](https://github.com/transprime-research/assets/blob/master/laravel-chained/twitter_header_photo_2.png)

[ ![Build Status](https://camo.githubusercontent.com/5fe9b475bcc33cd5efe482c0b8b66be5884df456a028711404f8ef8559568f07/68747470733a2f2f7472617669732d63692e6f72672f7472616e737072696d652d72657365617263682f6c61726176656c2d636861696e65642e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/transprime-research/laravel-chained)[ ![Latest Stable Version](https://camo.githubusercontent.com/891339c56ad605fd42b2c4ab66ece975a4a1fdf08b91bf362af279b8fb40424c/68747470733a2f2f706f7365722e707567782e6f72672f7472616e737072696d652d72657365617263682f6c61726176656c2d636861696e65642f762f737461626c65)](https://packagist.org/packages/transprime-research/laravel-chained)[ ![Total Downloads](https://camo.githubusercontent.com/fefa056830bf49dce5644411e2283fca547aa157fc0f2cf6e7462af67af30e63/68747470733a2f2f706f7365722e707567782e6f72672f7472616e737072696d652d72657365617263682f6c61726176656c2d636861696e65642f646f776e6c6f616473)](https://packagist.org/packages/transprime-research/laravel-chained)[ ![Latest Unstable Version](https://camo.githubusercontent.com/2976876f20b21dd16ffeac61fd816e3d14da40ba6d5a1faf9bc5bdd0e2908552/68747470733a2f2f706f7365722e707567782e6f72672f7472616e737072696d652d72657365617263682f6c61726176656c2d636861696e65642f762f756e737461626c65)](https://packagist.org/packages/transprime-research/laravel-chained)[ ![Latest Monthly Downloads](https://camo.githubusercontent.com/8fa104051443060fc87ed21d596298cb5e8aca251bb8091b970e3df7df5d2063/68747470733a2f2f706f7365722e707567782e6f72672f7472616e737072696d652d72657365617263682f6c61726176656c2d636861696e65642f642f6d6f6e74686c79)](https://packagist.org/packages/transprime-research/laravel-chained) [ ![License](https://camo.githubusercontent.com/3b9ccaefd23e197f1a1dd758462cc5a420c3685cfb8d99afae42478d05944b12/68747470733a2f2f706f7365722e707567782e6f72672f7472616e737072696d652d72657365617263682f6c61726176656c2d636861696e65642f6c6963656e7365)](https://packagist.org/packages/transprime-research/laravel-chained)

About Laravel-chained
---------------------

[](#about-laravel-chained)

Laravel chained help to chain method calls on any class.

> Do it Like a PRO 🆗

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

[](#installation)

- `composer require transprime-research/laravel-chained`

Quick Usage
-----------

[](#quick-usage)

Say we have this class with a lot of static methods. Instead of:

```
$value = Str::lower('ChainedOnStr');
$value = Str::snake($value);
$value = Str::before($value, '_');
$value = Str::length($value); //7
```

You use:

```
$value = chained(Str::class, )
    ->to('lower', 'ChainedOnStr')
    ->to('snake')
    ->to('before', '_')
    ->to('length')(); //14
```

Or Aliased method calls:

```
$value = chained(Str::class)
    ->lower('ChainedOnStr')
    ->snake()
    ->before('_')
    ->length()(); //7
```

Other Usages
------------

[](#other-usages)

### tap() method

[](#tap-method)

```
$value = chained(Str::class)
    ->to('lower', 'ChainedOnStr')
    ->tap(function ($res) {
        var_dump($res);
    })
    ->to('snake')
    ->to('length')
    ->up(); //Up is used instead of ()
```

Coming Soon
-----------

[](#coming-soon)

### Chain on more classes

[](#chain-on-more-classes)

```
use Transprime\Chained\Chained;

$value = chained(DB::class)->to('resolveDb', 'ChainedOnStr')
    ->chain(Str::class, function (Chained $chain) {

        return $chain->to('lower')->to('snake');

    })
    ->chain(Arr::class, function (Chained $chain) {

        return $chain->to('wrap')->to('add', 1, 'using_add');
    })();

//Or

chained(DB::class)
    ->to('resolveDb', 'ChainedOnStr')
    ->chain(Str::class) // next calls use `Str` class
    ->to('lower')->to('snake')
    ->chain(Arr::class) // next calls use `Arr` class
    ->to('wrap')->to('add', 1, 'using_add')();
```

> Api implementation to be decided

Additional Information
----------------------

[](#additional-information)

This package is part of a series of "Code Dare".

See other packages in this series here:

- A smart PHP if...elseif...else statement
- A functional PHP pipe in object-oriented way
- Array now an object
- A smart PHP try...catch statement
- A smart Carbon + Collection package
- Jsonable Http Request(er) package with Collections response

Contributions
-------------

[](#contributions)

For new features, checkout with prefix `feature/#issueid` e.g `feature/#100-add-auto-deploy`

- Clone this repository
- run `sh dockerizer.sh` or `bash dockerizer.sh`
- execute into the docker environment with `docker-compose exec conditional sh` (`sh` can be another bash)
- run tests with `vendor/bin/phpunit`

> The docker setup was made easy using [Laravel Dockerizer](https://github.com/transprime-research/laravel-dockerizer)

Similar packages
----------------

[](#similar-packages)

Licence
-------

[](#licence)

MIT (See LICENCE file)

###  Health Score

21

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

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

1609d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/364011bafbabff7b8c66b670b16ae372944dd4cc555531affffd901aae53d297?d=identicon)[omitobisam](/maintainers/omitobisam)

---

Top Contributors

[![omitobi](https://avatars.githubusercontent.com/u/16482234?v=4)](https://github.com/omitobi "omitobi (18 commits)")

---

Tags

phplaravelhelpersOOPLaravel-Chained

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/transprime-research-laravel-chained/health.svg)

```
[![Health](https://phpackages.com/badges/transprime-research-laravel-chained/health.svg)](https://phpackages.com/packages/transprime-research-laravel-chained)
```

###  Alternatives

[dragon-code/support

Support package is a collection of helpers and tools for any project.

238.2M74](/packages/dragon-code-support)[event4u/data-helpers

Framework-agnostic PHP library for data mapping, DTOs and utilities. Includes DataMapper, SimpleDto/LiteDto, DataAccessor/Mutator/Filter and helper classes (MathHelper, EnvHelper, etc.). Works with Laravel, Symfony/Doctrine or standalone PHP.

1411.8k](/packages/event4u-data-helpers)[transprime-research/piper

PHP Pipe method execution with values from chained method executions

174.6k1](/packages/transprime-research-piper)

PHPackages © 2026

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