PHPackages                             drkwolf/laravel-user - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. drkwolf/laravel-user

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

drkwolf/laravel-user
====================

laravel auth

5.8.4(7y ago)038PHPCI failing

Since Apr 24Pushed 6y ago1 watchersCompare

[ Source](https://github.com/drkwolf/laravel-user)[ Packagist](https://packagist.org/packages/drkwolf/laravel-user)[ RSS](/packages/drkwolf-laravel-user/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)Dependencies (2)Versions (9)Used By (0)

Introduction
============

[](#introduction)

Manage User model that has multiple roles, complex data that change with the role or the context, and multiple contacts

Features:

- handle optional data: filter and validation
- handle contacts

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

[](#dependencies)

- drkwolf/laravel-handler : for request handler and data presenter
- spatie/laravel-medialibrary : Optional, form user's avatar
- laravel/passport : Optional, authentication
- santigarcor/laratrust : Optional managing teams and groups

Database
--------

[](#database)

```
Schema::create('users', function(Blueprint $table) {
    $table->increments('id');

    $table->string('username')->unique()->nullable();
    $table->string('phone')->unique()->nullable();
    $table->string('email')->unique()->nullable();
    $table->string('password')->nullable();

    $table->tinyInteger('active')->default(0);

    $table->string('first_name')->nullable();
    $table->string('last_name')->nullable();
    $table->enum('sex', ['M', 'F'])->nullable();

    $table->json('options')->nullable();
    $table->json('contacts')->nullable();

    $table->timestamps();
    $table->softDeletes();
});

Schema::create('tutor_user', function(Blueprint $table) {
    $table->integer('user_id');
    $table->integer('tutor_id');
    $table->json('options')->nullable();

    $table->timestamps();
});
```

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

[](#configuration)

publish the configuration file

```
php artisan vendor:publish --provider="drkwolf\Larauser\LarauserServiceProvider" --tag="config"
```

setup user model parameters

```
'model' => [
    // field name ($request)
    'avatar_field' => 'avatar',
    // filesystem disk where default pic is
    // public disk should have url attribute !
    'avatar_disk' => 'public',
    'avatar_collection' => 'avatars',
    'avatar_default' => 'defaults/avatar-102.png',
    // validation rules
    'rules' => [
        'default' => [
            'first_name'    => 'required|string|max:50'
            // ...
        ]
    ]
]
```

rules can also be a function

```
'model' => [
    //...
    'rules' => [
        'default' => function ($user_model) {
            return [
                // ...
                'email'         => 'nullable|email|unique:users,email' . ",{$user_model->id}"
            ]
        }
        ],
    ]
]
```

default Handlers
----------------

[](#default-handlers)

### UserCredentialHandler

[](#usercredentialhandler)

Update credentials password, email, username and phone

actionfieldseventupdatepassword, email\*, username\*, phone\*CredentialUpdatedEventresetPasswordpasswordCredentialUpdatedEvent\*: optional fields

### UserHandler

[](#userhandler)

handle user main fields, options and contacts

actionfieldseventattachAvatarattachAvatarcreate\*UserCreatedEventupdate\*UserUpdatedEvent### UserInfoHandler

[](#userinfohandler)

same as UserHandler but doesn't handle options field

Managing Users
--------------

[](#managing-users)

```
use drkwolf\Package\Presenter\DefaultPresenter as Presenter;
// creating
$presenter = new Presenter();
$action = 'create'
$response = UserHandler::resolve(
    $action, $params = [],
    $presenter, $request->data, 'admin');

// updating
$presenter = new UserPresenter();
$action = 'update'
$response = UserHandler::resolve(
    $action, $params = [],
    $presenter, $request->data, 'admin');
```

HasOptions Trait
----------------

[](#hasoptions-trait)

see docs/options

HasContacts Trait
-----------------

[](#hascontacts-trait)

see docs/contacts

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

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

Total

8

Last Release

2545d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/49de6e4f74f0563c7d1073508ef4e6fbae748d73aa6b75f94eb71a56aa9c587e?d=identicon)[drkwolf](/maintainers/drkwolf)

---

Top Contributors

[![drkwolf](https://avatars.githubusercontent.com/u/1324686?v=4)](https://github.com/drkwolf "drkwolf (30 commits)")

### Embed Badge

![Health badge](/badges/drkwolf-laravel-user/health.svg)

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

###  Alternatives

[dusterio/lumen-passport

Making Laravel Passport work with Lumen

6511.3M9](/packages/dusterio-lumen-passport)[corbosman/laravel-passport-claims

Add claims to Laravel Passport JWT Tokens

88655.9k](/packages/corbosman-laravel-passport-claims)[smartins/passport-multiauth

Add support to multi-auth on Laravel Passport

285324.2k1](/packages/smartins-passport-multiauth)[coderello/laravel-passport-social-grant

Social Grant for Laravel Passport

179607.4k3](/packages/coderello-laravel-passport-social-grant)[jeremy379/laravel-openid-connect

OpenID Connect support to the PHP League's OAuth2 Server. Compatible with Laravel Passport.

55342.3k2](/packages/jeremy379-laravel-openid-connect)[adaojunior/passport-social-grant

Social grant for Laravel Passport

116279.2k1](/packages/adaojunior-passport-social-grant)

PHPackages © 2026

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