PHPackages                             philiplb/crudlexuser - 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. [Admin Panels](/categories/admin)
4. /
5. philiplb/crudlexuser

ActiveLibrary[Admin Panels](/categories/admin)

philiplb/crudlexuser
====================

CRUDlexUser is a library offering an user provider for symfony/security.

0.14.0(7y ago)22.2kMITPHPPHP &gt;=7.1CI failing

Since Mar 1Pushed 6y ago2 watchersCompare

[ Source](https://github.com/philiplb/CRUDlexUser)[ Packagist](https://packagist.org/packages/philiplb/crudlexuser)[ Docs](https://github.com/philiplb/CRUDlexUser)[ RSS](/packages/philiplb-crudlexuser/feed)WikiDiscussions master Synced 1mo ago

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

CRUDlex User
============

[](#crudlex-user)

CRUDlexUser is a library offering an user provider for symfony/security.

[![Total Downloads](https://camo.githubusercontent.com/31a470d52aae8887a614cf63a2f9e0265de412d05d2f5b543168a568fef0471b/68747470733a2f2f706f7365722e707567782e6f72672f7068696c69706c622f637275646c6578757365722f646f776e6c6f6164732e737667)](https://packagist.org/packages/philiplb/crudlexuser)[![Latest Stable Version](https://camo.githubusercontent.com/a8a54daa8125a760af19c3a3300e7c3779cca15495ba930ef26f9624d47146f4/68747470733a2f2f706f7365722e707567782e6f72672f7068696c69706c622f637275646c6578757365722f762f737461626c652e737667)](https://packagist.org/packages/philiplb/crudlexuser)[![Latest Unstable Version](https://camo.githubusercontent.com/d52679f8db8ac44181619a26f553514cd7982cd72d004f13ac4a78aeb645bf82/68747470733a2f2f706f7365722e707567782e6f72672f7068696c69706c622f637275646c6578757365722f762f756e737461626c652e737667)](https://packagist.org/packages/philiplb/crudlexuser) [![License](https://camo.githubusercontent.com/7b78d0ec1ec6bd6424735e8178c797bcc98226cc1062a9a4281bf7ab4d31f73a/68747470733a2f2f706f7365722e707567782e6f72672f7068696c69706c622f637275646c6578757365722f6c6963656e73652e737667)](https://packagist.org/packages/philiplb/crudlexuser)

API Documentation
-----------------

[](#api-documentation)

The CRUDlexUser API itself is documented here:

- [0.14.0](http://philiplb.github.io/CRUDlexUser/docs/api/0.14.0/) (upcoming)
- [0.13.0](http://philiplb.github.io/CRUDlexUser/docs/api/0.13.0/)
- [0.12.0](http://philiplb.github.io/CRUDlexUser/docs/api/0.12.0/)
- [0.11.0](http://philiplb.github.io/CRUDlexUser/docs/api/0.11.0/)
- [0.10.0](http://philiplb.github.io/CRUDlexUser/docs/api/0.10.0/)
- [0.9.10](http://philiplb.github.io/CRUDlexUser/docs/api/0.9.10/)
- [0.9.9](http://philiplb.github.io/CRUDlexUser/docs/api/0.9.9/)
- [0.9.8](http://philiplb.github.io/CRUDlexUser/docs/api/0.9.8/)

Upcoming bleeding edge:

- [Upcoming](http://philiplb.github.io/CRUDlexUser/docs/api/upcoming/)

Generated via (assuming APIGen is globally installed like `composer global require ...` and the PHP version is at maximum 7.1):

```
~/.composer/vendor/bin/apigen generate
```

Package
-------

[](#package)

CRUDlexUser uses [SemVer](http://semver.org/) for versioning. Currently, the API changes quickly due to be &lt; 1.0.0, so take care about notes in the changelog when upgrading.

### Stable

[](#stable)

```
"require": {
    "philiplb/crudlexuser": "0.14.0"
}
```

### Bleeding Edge

[](#bleeding-edge)

```
"require": {
    "philiplb/crudlexuser": "0.15.x-dev"
}
```

Usage
-----

[](#usage)

This library offers two parts. First, a management interface for your admin panel to perform CRUD operations on your userbase and second, an symfony/security UserProvider offering in order to connect the users with the application.

### The Admin Panel

[](#the-admin-panel)

The admin panel for your users is based on [CRUDlex](https://github.com/philiplb/CRUDlex). So all you have to do is to add the needed entities to your crud.yml from the following sub chapters.

In order to get the salt generated and the password hashed, you have to let the library add some CRUDlex events in your initialization:

```
$crudUserSetup = new CRUDlex\UserSetup();
$crudUserSetup->addEvents($app['crud']->getData('user'));
```

#### Users

[](#users)

```
user:
    label: User
    table: user
    fields:
        username:
            type: text
            label: Username
            required: true
            unique: true
        password:
            type: text
            label: Password Hash
            description: 'Set this to your desired password. Will be automatically converted to an hash value not meant to be readable.'
            required: true
        salt:
            type: text
            label: Password Salt
            description: 'Auto populated field on user creation. Used internally.'
            required: false
        userRoles:
            type: many
            label: Roles
            many:
                entity: role
                nameField: role
                thisField: user
                thatField: role
```

Plus any more fields you need. Recommended for the password reset features:

```
email:
    type: text
    label: E-Mail
    required: true
    unique: true
```

#### Roles

[](#roles)

```
role:
    label: Roles
    table: role
    fields:
        role:
            type: text
            label: Role
            required: true
```

#### Password Reset

[](#password-reset)

In case you want to use the password reset features:

```
passwordReset:
    label: Password Resets
    table: password_reset
    fields:
        user:
            type: reference
            label: User
            reference:
                nameField: username
                entity: user
            required: true
        token:
            type: text
            label: Token
            required: true
        reset:
            type: datetime
            label: Reset
```

### The UserProvider

[](#the-userprovider)

Simply instantiate and add it to your symfony/security configuration:

```
$userProvider = new CRUDlex\UserProvider($app['crud']->getData('user'), $app['crud']->getData('userRole'));
$app->register(new Silex\Provider\SecurityServiceProvider(), array(
    'security.firewalls' => array(
        'admin' => array(
            //...
            'users' => $userProvider
        ),
    ),
));
```

### Accessing Data of the Logged in User

[](#accessing-data-of-the-logged-in-user)

In order to get the user data from the logged in user in your controller, you might grab him like this:

```
$user = $app['security.token_storage']->getToken()
```

You get back a CRUDlex\\User instance having some getters, see the API docs.

Build Status
------------

[](#build-status)

[![Build Status](https://camo.githubusercontent.com/5e9660942614fe083b6bafc6203c4c0503b2824c4d9b28a67f527c89cedacfc0/68747470733a2f2f7472617669732d63692e6f72672f7068696c69706c622f435255446c6578557365722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/philiplb/CRUDlexUser)[![Coverage Status](https://camo.githubusercontent.com/aacbe8cc338b34930ebe6d13146e4ac6c0381259c81f01c33267087d8436cad1/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f7068696c69706c622f435255446c6578557365722f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/philiplb/CRUDlexUser?branch=master)

Code Quality
------------

[](#code-quality)

[![SensioLabsInsight](https://camo.githubusercontent.com/f1bd2a17b0e3d56bcc77bfed4cdc98a19504b5021139e247766a3b1b15717f81/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f64643633636537662d333439662d343264642d386537312d3037363935306237323665352f6d696e692e706e67)](https://insight.sensiolabs.com/projects/dd63ce7f-349f-42dd-8e71-076950b726e5)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/3fb2f1a021d2cc427c76eb0a7264f57f01898cd94bb8099c9215dd95d1bc248a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7068696c69706c622f435255446c6578557365722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/philiplb/CRUDlexUser/?branch=master)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

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.

###  Release Activity

Cadence

Every ~131 days

Recently: every ~179 days

Total

8

Last Release

2810d ago

PHP version history (3 changes)0.9.8PHP &gt;=5.3.0

0.10.0PHP &gt;=5.5

0.14.0PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/01057139b178118459e3f2287f208d5a0730f1d9f2c8b9032a210936607abaff?d=identicon)[philiplb](/maintainers/philiplb)

---

Top Contributors

[![philiplb](https://avatars.githubusercontent.com/u/1672238?v=4)](https://github.com/philiplb "philiplb (117 commits)")

---

Tags

securitycrudUser managementsilexsymfony security

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/philiplb-crudlexuser/health.svg)

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

###  Alternatives

[backpack/crud

Quickly build admin interfaces using Laravel, Bootstrap and JavaScript.

3.4k3.4M207](/packages/backpack-crud)[appzcoder/crud-generator

Laravel CRUD Generator

1.4k581.4k7](/packages/appzcoder-crud-generator)[friendsofcake/crud

CakePHP Application development on steroids - rapid prototyping / scaffolding &amp; production ready code - XML / JSON APIs and more

3751.4M25](/packages/friendsofcake-crud)[laravelrus/sleepingowl

Administrative interface builder for Laravel.

810219.6k3](/packages/laravelrus-sleepingowl)[ibex/crud-generator

Laravel CRUD Generator

706235.0k](/packages/ibex-crud-generator)[backpack/pagemanager

Create admin panels for presentation websites on Laravel, using page templates and Backpack\\CRUD.

371522.6k6](/packages/backpack-pagemanager)

PHPackages © 2026

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