PHPackages                             frictionlessdigital/actions - 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. frictionlessdigital/actions

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

frictionlessdigital/actions
===========================

Frictionless Solutions | Actions

12.0.0(1y ago)01.1k↓50%[4 PRs](https://github.com/Frictionlessdigital/actions/pulls)1MITPHPPHP ^8.2CI passing

Since Aug 23Pushed 2mo ago5 watchersCompare

[ Source](https://github.com/Frictionlessdigital/actions)[ Packagist](https://packagist.org/packages/frictionlessdigital/actions)[ RSS](/packages/frictionlessdigital-actions/feed)WikiDiscussions v12.x Synced 1mo ago

READMEChangelog (8)Dependencies (4)Versions (18)Used By (1)

FLS :: Actions
==============

[](#fls--actions)

Based on phenomenal [Loris Leiva](https://lorisleiva.com/) [Actions for Laravel](https://laravelactions.com/), this package is just a wrapper with a few methods added to sugar-syntax it.

This is for version 10.x and above, which is NOT directly compatible with 1.x.

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

[](#installation)

```
composer require frictionlessdigital/actions
```

**Note that root namespace for the package is `Fls` not `Frictionlessditial`.**

### Config

[](#config)

The package does not require configuration.

Usage
-----

[](#usage)

Read base documentation here: [Laravel Actions](https://laravelactions.com/)

### Action::tap($value, $closure)

[](#actiontapvalue-closure)

The protected method is similar to `tap()`: will return the `$value` after passing it to the `$closure`.

```
return $this->tap(User::first(), fn(User $user) => $user->delete());
```

is the equivalent of

```
$user = User::first();

$user->delete();

return $user;

// $user;
```

### Action::pipe($value, $closure)

[](#actionpipevalue-closure)

Similar to `pipe()`, this protected method will return the result `$value` after running the `$closure`; closure is free to modify the `$value`.

```
return $this->pipe(User::first(), fn($user) => $user->delete());
```

is the equivalent of

```
$user = User::first();

return $user->delete();

// true;
```

### Action::validated()

[](#actionvalidated)

This is an alias for `validateAttributes()` - returns an array of attributes validated through `rules()`.

```
use Fls\Actions\Action;

class UserAction extends Action
{
    public function rules()
    {
        return [
            'name' => ['required', 'string'],
            'email' => ['required', 'email'],
            'notes' => ['nullable', 'string'],
        ];
    }

    ...
    public function handle($attributes) {
        return $this->fill($attributes)->validated();
    }
}

UserAction::run([
    'name' => 'John',
    'email' => 'john@smith.com',
]);

//  ['name' => 'John', 'email' => 'john@smith.com']
```

### Action::validate()

[](#actionvalidate)

This method will validate the attribute, throw an exception is data is not valid, but the return value is the class itself; good for chaining.

```
use Fls\Actions\Action;

class UserAction extends Action
{
    ...
    public function handle(User $user, $attributes) {
        return $this->fill($attributes)
                    ->validate()
                    ->tap($user, fn(User $user) => $user->update($this->validated()));
    }
}
```

Could be useful if you need to make sure validation is complete before chaining-in another action.

### Action::runInTransaction(...$attributes)

[](#actionrunintransactionattributes)

This method will wrap the action in a DB transaction.

```
use Fls\Actions\Action;
use App\User;

class CreateUserAction extends Action
{
    public function handle(User $user, $attributes)
    {
        return $user->create($attributes);
    }
}
```

and can be executed using `run` and `runInTransaction` alike. In the latter case, the action will be executed inside a `DB::transaction`. Return value would match between the two.

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Cyrill N Kalita](https://github.com/nickfls)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

---

[![](./resources/docs/gramma.png)](http://frictionlesssolutions.com "Fricitonless Solutions Inc.")

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance68

Regular maintenance activity

Popularity18

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 84.6% 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 ~145 days

Recently: every ~77 days

Total

12

Last Release

128d ago

Major Versions

1.0.0 → 9.0.02022-01-18

9.0.0 → 10.0.02023-04-02

v9.x-dev → 11.0.02024-03-13

11.1 → 12.0.02025-03-03

v11.x-dev → v12.x-dev2026-01-06

PHP version history (4 changes)1.0.0PHP ^7.3 || ^8.0

9.0.0PHP ^7.4 || ^8.0

10.0.0PHP ^8.1

11.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/d6897fa24df64545b665dc9b4707e5f69d766ab4d2a1b5b13041e22d7eb8b30d?d=identicon)[cyrill@frictionlesssolutions.com](/maintainers/cyrill@frictionlesssolutions.com)

---

Top Contributors

[![nickfls](https://avatars.githubusercontent.com/u/12013206?v=4)](https://github.com/nickfls "nickfls (11 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laravelactionsfls

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/frictionlessdigital-actions/health.svg)

```
[![Health](https://phpackages.com/badges/frictionlessdigital-actions/health.svg)](https://phpackages.com/packages/frictionlessdigital-actions)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[tormjens/eventy

The WordPress filter/action system in Laravel

438912.9k16](/packages/tormjens-eventy)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

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

A Laravel package to ease defining navigation menus

433.1k](/packages/nedwors-navigator)

PHPackages © 2026

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