PHPackages                             spotonlive/sl-entrust-doctrine-orm - 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. spotonlive/sl-entrust-doctrine-orm

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

spotonlive/sl-entrust-doctrine-orm
==================================

Doctrine2 ORM - Zizco Entrust (Laravel 5.1) for Zizco Entrust

0.0.1(10y ago)01.7k2[1 issues](https://github.com/spotonlive/sl-entrust-doctrine-orm/issues)MITPHPPHP &gt;=5.4.0

Since Dec 22Pushed 10y ago3 watchersCompare

[ Source](https://github.com/spotonlive/sl-entrust-doctrine-orm)[ Packagist](https://packagist.org/packages/spotonlive/sl-entrust-doctrine-orm)[ Docs](https://github.com/spotonlive/sl-entrust-doctrine-orm)[ RSS](/packages/spotonlive-sl-entrust-doctrine-orm/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (8)Versions (2)Used By (0)

Doctrine2 ORM - zizaco/entrust
==============================

[](#doctrine2-orm---zizacoentrust)

[![Latest Stable Version](https://camo.githubusercontent.com/e4b8256f8b55f325ac25fe71badbe95eb2576ba5c8e80a4d71a2daa89712a800/68747470733a2f2f706f7365722e707567782e6f72672f73706f746f6e6c6976652f736c2d656e74727573742d646f637472696e652d6f726d2f762f737461626c65)](https://packagist.org/packages/spotonlive/sl-entrust-doctrine-orm) [![Total Downloads](https://camo.githubusercontent.com/0b036c3274a56e4274ff8589e1d7204462aa7da64d99bd4fb16f07bf68491466/68747470733a2f2f706f7365722e707567782e6f72672f73706f746f6e6c6976652f736c2d656e74727573742d646f637472696e652d6f726d2f646f776e6c6f616473)](https://packagist.org/packages/spotonlive/sl-entrust-doctrine-orm) [![Latest Unstable Version](https://camo.githubusercontent.com/a98d91c8e93fe062128db5335c743bb224ac3fdf62cd7a70f2c0a3265aa48e58/68747470733a2f2f706f7365722e707567782e6f72672f73706f746f6e6c6976652f736c2d656e74727573742d646f637472696e652d6f726d2f762f756e737461626c65)](https://packagist.org/packages/spotonlive/sl-entrust-doctrine-orm) [![License](https://camo.githubusercontent.com/5c6b6f3def5ea011a94687394ddbd4cfda85be62c53b5d10f937179d3f9dc0f4/68747470733a2f2f706f7365722e707567782e6f72672f73706f746f6e6c6976652f736c2d656e74727573742d646f637472696e652d6f726d2f6c6963656e7365)](https://packagist.org/packages/spotonlive/sl-entrust-doctrine-orm)

**THIS PACKAGE IS UNDER DEVELOPMENT**

Configuration
-------------

[](#configuration)

### Installation

[](#installation)

Run `$ composer require spotonlive/sl-entrust-doctrine-orm`

**config/app.php**

```
    'providers' => [
	    (...)
		SpotOnLive\EntrustDoctrineORM\EntrustDoctrineORMServiceProvider::class,
        'Zizaco\Entrust\EntrustServiceProvider',
	    (...)
	]

    'aliases' => [
	    (...)
        'Entrust' => 'Zizaco\Entrust\EntrustFacade'
	    (...)
	]

```

**User.php**

```
use Doctrine\Common\Collections\ArrayCollection;

class User implements \SpotOnLive\EntrustDoctrineORM\Entities\UserRoleInterface
{
    /**
     * @var \SpotOnLive\EntrustDoctrineORM\Entities\RoleInterface[]|ArrayCollection
     *
     * @ORM\ManyToMany(targetEntity="SpotOnLive\EntrustDoctrineORM\Entities\Role")
     * @ORM\JoinTable(name="user_role_linker",
     *      joinColumns={@ORM\JoinColumn(name="user_id", referencedColumnName="id")},
     *      inverseJoinColumns={@ORM\JoinColumn(name="role_id", referencedColumnName="id")}
     *      )
     **/
    protected $roles;

    public function __construct()
    {
        $this->roles = new ArrayCollection();
    }

    /**
     * @return ArrayCollection|\SpotOnLive\EntrustDoctrineORM\Entities\RoleInterface[]
     */
    public function getRoles()
    {
        return $this->roles;
    }

    /**
     * @param ArrayCollection|\SpotOnLive\EntrustDoctrineORM\Entities\RoleInterface[] $roles
     */
    public function setRoles($roles)
    {
        $this->roles = $roles;
    }

    /**
     * @param \SpotOnLive\EntrustDoctrineORM\Entities\RoleInterface[] $roles
     */
    public function addRoles($roles)
    {
        $this->roles->add($roles);
    }

    /**
     * @param \SpotOnLive\EntrustDoctrineORM\Entities\RoleInterface[] $roles
     */
    public function removeRoles($roles)
    {
        $this->roles->remove($roles);
    }

    (...)
}
```

### Traits

[](#traits)

Use `\SpotOnLive\EntrustDoctrineORM\Traits\EntrustDoctrineORMUserTrait` in your entity.

### Migrations

[](#migrations)

- Difference: `$ vendor/bin/doctrine-laravel migrations:diff`
- Migrate: `$ vendor/bin/doctrine-laravel migrations:migrate`

[*laravel-doctrine/migrations*](https://github.com/laravel-doctrine/migrations)

Dependencies
------------

[](#dependencies)

- [**zizaco/entrust**](https://github.com/Zizaco/entrust)

Doctrine for laravel
--------------------

[](#doctrine-for-laravel)

- [**laravel-doctrine/orm**](https://packagist.org/packages/laravel-doctrine/orm)

Organization &amp; authors
--------------------------

[](#organization--authors)

- [**spotonlive**](https://github.com/spotonlive)
- [**nikolajlovenhardt**](https://github.com/nikolajlovenhardt)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.7% 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

3791d ago

### Community

Maintainers

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

---

Top Contributors

[![nikolajlovenhardt](https://avatars.githubusercontent.com/u/3541622?v=4)](https://github.com/nikolajlovenhardt "nikolajlovenhardt (22 commits)")[![NikolajPetersen](https://avatars.githubusercontent.com/u/70655036?v=4)](https://github.com/NikolajPetersen "NikolajPetersen (1 commits)")

---

Tags

laravelormdoctrinedoctrine2entrust

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/spotonlive-sl-entrust-doctrine-orm/health.svg)

```
[![Health](https://phpackages.com/badges/spotonlive-sl-entrust-doctrine-orm/health.svg)](https://phpackages.com/packages/spotonlive-sl-entrust-doctrine-orm)
```

###  Alternatives

[laravel-doctrine/orm

An integration library for Laravel and Doctrine ORM

8425.3M86](/packages/laravel-doctrine-orm)[ocramius/doctrine-batch-utils

A set of utilities to operate with Doctrine ORM's batch processing functionality

3331.6M6](/packages/ocramius-doctrine-batch-utils)[weirdan/doctrine-psalm-plugin

Stubs to let Psalm understand Doctrine better

876.9M50](/packages/weirdan-doctrine-psalm-plugin)[laravel-doctrine/extensions

Doctrine extensions for Laravel

493.5M19](/packages/laravel-doctrine-extensions)[laravel-doctrine/acl

ACL for Laravel and Doctrine

44445.3k7](/packages/laravel-doctrine-acl)[laravel-doctrine/fluent

A fluent PHP mapping driver for Doctrine2.

43430.3k12](/packages/laravel-doctrine-fluent)

PHPackages © 2026

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