PHPackages                             nasyrov/laravel-interactions - 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. nasyrov/laravel-interactions

ActiveLibrary

nasyrov/laravel-interactions
============================

Laravel package for interactions.

v1.0.5(8y ago)61255MITPHPPHP &gt;=7.0

Since Jun 13Pushed 8y agoCompare

[ Source](https://github.com/nasyrov/laravel-interactions)[ Packagist](https://packagist.org/packages/nasyrov/laravel-interactions)[ Docs](https://github.com/nasyrov/laravel-interactions)[ RSS](/packages/nasyrov-laravel-interactions/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (6)Dependencies (6)Versions (7)Used By (0)

Laravel Interactions
====================

[](#laravel-interactions)

[![Latest Version on Packagist](https://camo.githubusercontent.com/aae89d9595b7f1cdfb879161255981f4bc60b2be030b35b061f9442b3d9ae9d5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e617379726f762f6c61726176656c2d696e746572616374696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nasyrov/laravel-interactions)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/6a4a324a6b6c1ac683b259bf8b0b69d605d970c727ea39ea44e1a0572afc9559/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6e617379726f762f6c61726176656c2d696e746572616374696f6e732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/nasyrov/laravel-interactions)[![Coverage Status](https://camo.githubusercontent.com/fd02c9a26a7eed757a0ef4fb531e43e9cd082b924c499773182afacc3ef15081/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6e617379726f762f6c61726176656c2d696e746572616374696f6e732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/nasyrov/laravel-interactions/code-structure)[![Quality Score](https://camo.githubusercontent.com/8b07616c7b61a42a359dc6ef67dc112d002824bc89981e483e611c54463e99ea/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6e617379726f762f6c61726176656c2d696e746572616374696f6e732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/nasyrov/laravel-interactions)[![Total Downloads](https://camo.githubusercontent.com/4061d2b00cceb564b6a85a94fe3a1c1afd84dac0ca5cff91fa3e70d65f18e78f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e617379726f762f6c61726176656c2d696e746572616374696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nasyrov/laravel-interactions)

Laravel package for interactions.

Requirements
------------

[](#requirements)

Make sure all dependencies have been installed before moving on:

- [PHP](http://php.net/manual/en/install.php) &gt;= 7.0
- [Composer](https://getcomposer.org/download/)

Install
-------

[](#install)

Pull the package via Composer:

```
$ composer require nasyrov/laravel-interactions
```

Register the service provider in `config/app.php`:

```
'providers' => [
    ...
    Nasyrov\Laravel\Interactions\InteractionServiceProvider::class,
    ...
]
```

Usage
-----

[](#usage)

Let's generate a typical user registration flow with the use of interactions.

First, generate a `RegisterUser` interaction via the command:

```
$ php artisan make:interaction RegisterUser
```

The command above will create a new file `app/Interactions/RegisterUser.php`. Let's open the file and tailor it for our needs – create a new user:

```
use App\User;
use Illuminate\Http\Request;
use Nasyrov\Laravel\Interactions\Contracts\Interaction;

class RegisterUser implements Interaction
{
    /**
     * Handle the interaction.
     *
     * @return mixed
     */
    public function handle(Request $request)
    {
        return User::create([
            'name' => $request->name,
            'email' => $request->email,
            'password' => bcrypt($request->password),
        ]);
    }
}
```

Next, include the `CallsInteractions` trait into the base controller so we will be able to run the interactions in any other controller that extends the one:

```
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Nasyrov\Laravel\Interactions\CallsInteractions;

class Controller extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, CallsInteractions, ValidatesRequests;
}
```

Finally, in the `UsersController` controller run the `RegisterUser` interaction and pass the request object:

```
use App\Http\Controllers\Controller;
use App\Interaction\RegisterUser;
use Illuminate\Http\Request;

class UsersController extends Controller
{
    public function register(RegisterUserRequest $request)
    {
        return $this->interact(RegisterUser::class, [$request]);
    }
}
```

Testing
-------

[](#testing)

```
$ composer lint
$ composer test
```

Security
--------

[](#security)

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

Credits
-------

[](#credits)

- [Evgenii Nasyrov](https://github.com/nasyrov)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~71 days

Total

6

Last Release

2969d ago

PHP version history (2 changes)v1.0.0PHP &gt;=5.6.4

v1.0.3PHP &gt;=7.0

### Community

Maintainers

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

---

Top Contributors

[![conradwarhol](https://avatars.githubusercontent.com/u/1694076?v=4)](https://github.com/conradwarhol "conradwarhol (1 commits)")[![petrlz63](https://avatars.githubusercontent.com/u/31001678?v=4)](https://github.com/petrlz63 "petrlz63 (1 commits)")[![rasmuscnielsen](https://avatars.githubusercontent.com/u/8465957?v=4)](https://github.com/rasmuscnielsen "rasmuscnielsen (1 commits)")

---

Tags

interactionslaravellaravel-packagephplaravelinteractions

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/nasyrov-laravel-interactions/health.svg)

```
[![Health](https://phpackages.com/badges/nasyrov-laravel-interactions/health.svg)](https://phpackages.com/packages/nasyrov-laravel-interactions)
```

###  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)[laravel/ui

Laravel UI utilities and presets.

2.7k134.9M601](/packages/laravel-ui)[laravel/jetstream

Tailwind scaffolding for the Laravel framework.

4.1k19.8M136](/packages/laravel-jetstream)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[erag/laravel-disposable-email

A Laravel package to detect and block disposable email addresses.

226102.4k](/packages/erag-laravel-disposable-email)

PHPackages © 2026

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