PHPackages                             irishtitan/handshake - 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. [Framework](/categories/framework)
4. /
5. irishtitan/handshake

ActiveMagento2-module[Framework](/categories/framework)

irishtitan/handshake
====================

A Laravel style wrapper around Magento 2.

v1.4.1(8y ago)37737[3 issues](https://github.com/denisrpriebe/Handshake/issues)MITPHPPHP &gt;=7.0CI failing

Since Mar 27Pushed 6y ago4 watchersCompare

[ Source](https://github.com/denisrpriebe/Handshake)[ Packagist](https://packagist.org/packages/irishtitan/handshake)[ RSS](/packages/irishtitan-handshake/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (8)Dependencies (4)Versions (8)Used By (0)

Handshake
=========

[](#handshake)

[![Latest Stable Version](https://camo.githubusercontent.com/70f60df7599494fc2d26722f59c3e6a1867b4d5d02726434b04c415357aafbdf/68747470733a2f2f706f7365722e707567782e6f72672f6972697368746974616e2f68616e647368616b652f76657273696f6e)](https://packagist.org/packages/irishtitan/handshake) [![GitHub issues](https://camo.githubusercontent.com/c81015d60ab7a061cfdefb5013586fb09b52db906988aff54569ac247fe7a772/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f64656e6973727072696562652f48616e647368616b652e737667)](https://github.com/denisrpriebe/Handshake/issues) [![GitHub forks](https://camo.githubusercontent.com/8f2e4d0f35edca71cd253af6a2e2d011bfee9f224377e7d9d934b92934b7cd4e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f64656e6973727072696562652f48616e647368616b652e737667)](https://github.com/denisrpriebe/Handshake/network) [![GitHub stars](https://camo.githubusercontent.com/455f08c18b7a4752ed444bf4285e1edfc7730498dc6e003296aa4f853ee0a404/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f64656e6973727072696562652f48616e647368616b652e737667)](https://github.com/denisrpriebe/Handshake/stargazers) [![Total Downloads](https://camo.githubusercontent.com/f777ae732fcf633cd9c830c865e5d03562aa97a879d5f35e9b6f56e5e94227a6/68747470733a2f2f706f7365722e707567782e6f72672f6972697368746974616e2f68616e647368616b652f646f776e6c6f616473)](https://packagist.org/packages/irishtitan/handshake) [![License](https://camo.githubusercontent.com/11594d91dfcdf0a08fa831c1e14266efba4f856c0fc330bec7ce55227cb50815/68747470733a2f2f706f7365722e707567782e6f72672f6972697368746974616e2f68616e647368616b652f6c6963656e7365)](https://packagist.org/packages/irishtitan/handshake) [![Twitter](https://camo.githubusercontent.com/1700ba1ccf9f54b788e8dacb24becf8f5632e3dcf53b93aeb47d4cacd0d82005/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f75726c2f68747470732f6769746875622e636f6d2f64656e6973727072696562652f48616e647368616b652e7376673f7374796c653d736f6369616c)](https://twitter.com/intent/tweet?text=Yo,%20checkout%20this%20Magento%202%20%20module%20called%20Handshake:&url=%5Bobject%20Object%5D)

*I am not actively maintaining this package anymore. If you need to use it, feel free to fork it or contribute a pull request.*

Handshake is a Magento 2 module that is designed to make the Magento 2 module development experience easier and more elegant. It does this by replacing the default Magento 2 ORM system with Laravel's Eloquent Library. Any custom Magento 2 module you build using Handshake can use Laravel style Migrations, Seeders, Models, Sessions and more with corresponding commands.

Handshake has been tested with Magento versions 2.1.5 - 2.1.8.

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

[](#installation)

Before you install Handshake, make sure you have a working copy of Magento 2. Also make sure that Magento 2 is properly configured as Handshake will try and use Magento 2's database configuration to run your migrations, seeds, etc.

You can install Handshake with composer:

```
composer require irishtitan/handshake

```

After composer pulls in Handshake, you need to enable Handshake:

```
php bin/magento module:enable IrishTitan_Handshake

```

Finish the installation by running:

```
php bin/magento setup:upgrade

```

If everything went smoothly, you are now ready to begin developing Magento 2 modules with Handshake.

Object Manager
--------------

[](#object-manager)

Should we use the object manager? I don't think anyone really knows. Regardless, automatic constructor injection is what Magento recommends. There are however cases where you will need to use the object manager. Instead, do it in a more elegant way using the `IrishTitan\Handshake\Core\App` class.

```
use Magento\Catalog\Model\ProductFactory;
use IrishTitan\Handshake\Core\App;

$productFactory = App::make(ProductFactory::class);
```

You may also use `App::get()` to get an instance of the given class if it has already been instantiated.

Products
--------

[](#products)

Previously, when you worked with Magento 2 products you probably needed to use the `ProductFactory`, `ProductRepository`, `ProductCollection` and whatever else to accomplish what you wanted to do. This is no longer the case. Instead you may use the `IrishTitan\Handshake\Facades\Product` facade to perform a number of different actions. For example:

To find a product by its ID use the `find` method:

```
$product = Product::find(23);
```

To find a product by its SKU use the `whereSku` method:

```
$product = Product::whereSku('PROD0001');
```

To get all products in the Magento 2 catalog use the `all` method:

```
$products = Product::all();
```

To add an image to a product use the `addImage` method:

```
$product = Product::find(123);

$product->addImage('path/to/first/image.jpg');
$product->addImage('path/to/second/image.jpg');
```

Alternatively, you may also do this as all Handshake methods are chain-able:

```
Product::find(123)
    ->addImage('path/to/first/image.jpg')
    ->addImage('path/to/second/image.jpg');
```

To get an array of all the images a product has use the `images` method:

```
$product = Product::whereSku('PROD0002');
$images = $product->images();
```

To get all the categories a products is in use the `categories` method:

```
$product = Product::find(487);
$categories = $product->categories();
```

To create a new product you may use the `create` method:

```
$bmw = Product::create([
    'name' => 'BMW',
    'sku' => 'BMW0001',
    'url_key' => 'bmw0001',
    'price' => 65000
]);
```

To assign a product to a category us the `assignToCategory` method:

```
$category = Category::find(2);
$product = Product::find(13);

$product->assignToCategory($category);
```

In the above examples, `whereSku` and `find` both return an instance of `IrishTitan\Handshake\Core\Catalog\Product`. Please check out this class to get a better understanding of how things work.

Categories
----------

[](#categories)

Previously, when you worked with Magento 2 categories you probably needed to use the `CategoryFactory`, `CategoryRepository`, `CategoryCollection` and whatever else to accomplish what you wanted to do. This is no longer the case. Instead you may use the `IrishTitan\Handshake\Facades\Category` facade to perform a number of different actions. For example:

To find a category by its ID use the `find` method:

```
$category = Category::find(12);
```

The `find` method will return an instance of `IrishTitan\Handshake\Core\Catalog\Category` if found and `null` if the category is not found. You may also use `findOrFail($id)` method to have an error thrown if the category is not found.

To find a category by its URL key use the `whereUrlKey` method:

```
$category = Category::whereUrlKey('shoes');
```

To find a category by its name use the `whereName` method:

```
$category = Category::whereName('Shoes');
```

If more than one category have the same name, the first will be returned.

To get all categories use the `all` method:

```
$categories = Category::all();
```

To assign a product to a category use the `addProduct` method:

```
$nike = Product::whereSku('NIKE0001');

$category = Category::whereUrlKey('shoes');
$category->addProduct($nike);
```

If you need to have nested categories you may use the `setParent` method:

```
$cars = Category::whereUrlKey('cars');
$bmws = Category::whereUrlKey('bmws');

$bmws->setParent($cars);
$bmws->save();
```

The above are just a handful of methods that you may use. Please checkout the `IrishTitan\Handshake\Core\Catalog\Category` class to see the other available methods.

CLI Commands
------------

[](#cli-commands)

When writing custom functionality for Magento 2 such as an ERP integration or a custom script, it is generally easier to do this as a CLI command. Magento 2 has a command class which you may inherit from but it is still rather tedious to write your own custom commands. Instead you may use the Handshake command class. Before you use the below commands, make sure you module has a `Commands` directory. Of course if you created a module using Handshake's `handshake:make:module` command, this directory will already be present.

To create a new command, here is the syntax to use:

```
php bin/magento handshake:make:command Namespace Module CommandName

```

As an example, you may do something like:

```
php bin/magento handshake:make:command Acme Forum ImportThreadsCommmand

```

This will create a `ImportThreadsCommmand.php` file in `app/code/Acme/Forum/Commands`. Your command will also be automatically registered in the `etc/di.xml` file as all Magento 2 commands are required to be registered here. You may need to run `php bin/magento cache:clean` in order for your command to show up the command list.

##### Command Syntax

[](#command-syntax)

If for example you want to be able to run:

```
php bin/magento forum:threads:import

```

you will need to update the command signature property in your command file.

```
/**
 * The command syntax.
 *
 * @var string
 */
protected $signature = 'forum:threads:import';
```

##### Command Arguments

[](#command-arguments)

If you need for you command to accept arguments such as this:

```
php bin/magento forum:threads:import MagentoThreads

```

You may define your arguments in the `arguments` property in your command class:

```
/**
 * The arguments the command accepts.
 *
 * @var array
 */
protected $arguments = [

    'thread' => [
        'mode' => 'required',
        'description' => 'The thread name to import.'
    ]

];
```

Creating a New Module
---------------------

[](#creating-a-new-module)

To create a new Magento 2 module, you can use the `handshake:make:module` command:

```
php bin/magento handshake:make:module Namespace Module

```

The `handshake:make:module` command accepts two arguments. `Namespace` is your vendor name and `Module` is the name of your module.

For example, `php bin/magento handshake:make:module Acme Forum`. This will create a new module in `app/code/Acme/Forum`.

### Migrations

[](#migrations)

Once you have installed Handshake, a new directory will be created: `app/handshake`. This is where you may register your migrations and seeds. After creating a migration add it to `migrations.php`.

To create a new migration, you can use the `handshake:make:migration` command:

```
php bin/magento handshake:make:migration Namespace Module Migration

```

The `handshake:make:migration` command accepts three arguments. `Namespace` is your vendor name, `Module` is the name of your module and `Migration` is the name of your migration.

For example, `php bin/magento handshake:make:migration Acme Forum CreatePostsTable`

All migrations are stored within the setup folder of your corresponding module. Once you have created your migration, you should register it within `app/handshake/migrations.php`.

#### Running Your Migrations

[](#running-your-migrations)

You can run your migrations with the `handshake:migrate` command.

You can rollback your migrations with the `handshake:migrate:rollback` command.

License
-------

[](#license)

The Handshake Module is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 70.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 ~23 days

Recently: every ~32 days

Total

7

Last Release

3194d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c9347fd806ad51f6d190f23e43f258c43e56f1371020d7e5c8b80d6753977fa8?d=identicon)[denisrpriebe](/maintainers/denisrpriebe)

---

Top Contributors

[![denisrpriebe-it](https://avatars.githubusercontent.com/u/38865618?v=4)](https://github.com/denisrpriebe-it "denisrpriebe-it (24 commits)")[![denisrpriebe](https://avatars.githubusercontent.com/u/8739001?v=4)](https://github.com/denisrpriebe "denisrpriebe (10 commits)")

---

Tags

laravelmagento2magento

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/irishtitan-handshake/health.svg)

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

###  Alternatives

[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M532](/packages/laravel-passport)[composer/installers

A multi-framework Composer library installer

1.4k136.0M6.0k](/packages/composer-installers)[defstudio/pest-plugin-laravel-expectations

A plugin to add laravel tailored expectations to Pest

98548.9k4](/packages/defstudio-pest-plugin-laravel-expectations)

PHPackages © 2026

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