PHPackages                             ifnot/eloquent-vuex - 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. [Database &amp; ORM](/categories/database)
4. /
5. ifnot/eloquent-vuex

AbandonedArchivedLibrary[Database &amp; ORM](/categories/database)

ifnot/eloquent-vuex
===================

11501PHP

Since Jul 30Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Ifnot/eloquent-vuex-php)[ Packagist](https://packagist.org/packages/ifnot/eloquent-vuex)[ RSS](/packages/ifnot-eloquent-vuex/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Eloquent Vuex - WIP
===================

[](#eloquent-vuex---wip)

**Realtime model synchronization between Vuex (VueJs) and Eloquent (Laravel)**

This package allows you to send eloquent events (create, update and delete) through laravel echo as vuex mutations in order to keep all your clients data in sync with your laravel database.

This package is designed for an easy integration without deep changes of your laravel backend and vuex frontend.

Prerequisites
-------------

[](#prerequisites)

> Before using this package you should have a working Echo installation (client + server). [Please follow the official installation steps from the documentation](https://laravel.com/docs/5.5/broadcasting). You have to be able to send a ping from laravel and read it with Echo.

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

[](#installation)

```
composer require ifnot/eloquent-vuex

```

As it is a WIP, you may want lower your stability options in your `composer.json` :

```
"minimum-stability": "dev",
"prefer-stable": true

```

Then add the service provider into your `config/app.php` **before your Application Service Providers (important)** :

```
Ifnot\EloquentVuex\Providers\EloquentVuexServiceProvider::class,

```

Quick Start
-----------

[](#quick-start)

Listen your eloquent models for modifications into your `AppServiceProvider` :

```
use Ifnot\EloquentVuex\Vuex;

class AppServiceProvider extends ServiceProvider
{
    public function boot()
    {
        Vuex::sync([
            App\Car::class
        ]);
    }
}
```

Fine tuning
-----------

[](#fine-tuning)

Reference a `$store` property into your model for changing default event broadcasting behaviour :

```
class Car extends Model
{
    public $store = CarStore::class;

    // ...
}

class CarStore extends Ifnot\EloquentVuex\Vuex\Store
{
    public function getCascadeRelations(): array
    {
        // Return relations to be updated when this model changes
        // Example : if we have $car->user, the following line will update the related model for every changes
        return ['users'];
    }

    public function getNamespace(): string
    {
        // Changes the default module name on the client-side
        return 'MyCars';
    }

    public function toArray(Model $model): array
    {
        // How the model is converted to event payload
        // Example : a savage way to call a fractal transformer
        $fractal = new \League\Fractal\Manager();
        $resource = new \League\Fractal\Resource\Item($model, new CarTransformer());
        return $fractal->createData($resource)->toArray()['data'];
    }

    public function getStates(Model $model): array
    {
        // Which state to be mutated on the client side
        // Example : use a private channel instead the public one
        // To be documented : there is many other states for your app logic
        return [
            new \Ifnot\EloquentVuex\Vuex\States\State($this, 'all', new Illuminate\Broadcasting\PrivateChannel('my-private'))
        ];
    }
}
```

> Keep in mind that you can see the default behaviour by [reading the default Store implementation](https://github.com/Ifnot/eloquent-vuex-php/blob/master/src/Vuex/Store.php)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity40

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/9919b0657e5904f4e09a4b0232ebe75f595180a6ca793e360a3bd77fb553d807?d=identicon)[ifnot](/maintainers/ifnot)

---

Top Contributors

[![IfnotFr](https://avatars.githubusercontent.com/u/1242308?v=4)](https://github.com/IfnotFr "IfnotFr (26 commits)")

### Embed Badge

![Health badge](/badges/ifnot-eloquent-vuex/health.svg)

```
[![Health](https://phpackages.com/badges/ifnot-eloquent-vuex/health.svg)](https://phpackages.com/packages/ifnot-eloquent-vuex)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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