PHPackages                             majebry/laravel6-userable - 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. majebry/laravel6-userable

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

majebry/laravel6-userable
=========================

Multiple User Type Models for Laravel 6

v1.0.3(6y ago)1049MITPHP

Since Dec 15Pushed 6y ago1 watchersCompare

[ Source](https://github.com/majebry/laravel6-userable)[ Packagist](https://packagist.org/packages/majebry/laravel6-userable)[ RSS](/packages/majebry-laravel6-userable/feed)WikiDiscussions master Synced today

READMEChangelog (2)DependenciesVersions (5)Used By (0)

Laravel Userable
================

[](#laravel-userable)

This package transforms Laravel's `User` model to be an "abstract-like" model so that you can create as much separate userable (*user-type*) models as you wish with their auth controllers and a middleware by just running some command.

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

[](#installation)

Use composer dependency manager to install this package.

```
composer require majebry/laravel6-userable
```

Usage
-----

[](#usage)

1. publish migrations:

```
php artisan vendor:publish --provider="Majebry\LaravelUserable\UserableServiceProvider" --tag="migrations"
```

2. Include Userable trait into your Laravel's User model

```
class User extends Authenticatable
{
    use \Majebry\LaravelUserable\Traits\Userable;
    //...
}
```

So, anytime you want to call user info for any userable model you can do `Model::find($id)->userable`

3. Now, for example, if we want to generate a *user-type* called `Customer`, we run the following command

```
php artsian userable:make Customer
```

This command will generate a `Customer` model under `app` directory and a `x_create_customers_table.php` under `database\migrations` directory You can add the fields that you wish to that migration before running it

4. In app/Http/Kernal.php, register the following middleware

```
protected $routeMiddleware = [
    // ...
    'userable-auth' => \Majebry\LaravelUserable\Http\Middleware\UserTypeMiddleware::class,
];
```

Now for example, if you want to protect a route to be only accessible for `StoreAdmin`, you can chain the Route with `->middleware('userable-auth:store-admin')`

Contributing
------------

[](#contributing)

...

Todo
----

[](#todo)

- Probably make the generator command also generates custom authentication actions(routes and controllers), middleware and/or views with the generator command.
- Add tests
- Making the UserTypeMiddleware supports multiple user-types
- Hooking into on User/Userable `Delete` event?

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

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

Total

4

Last Release

2281d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8674ef089d97f81045582d0b072a1210b6a17bd5066895165a6d8bec89c60772?d=identicon)[majebry](/maintainers/majebry)

---

Top Contributors

[![majebry](https://avatars.githubusercontent.com/u/7958772?v=4)](https://github.com/majebry "majebry (7 commits)")

### Embed Badge

![Health badge](/badges/majebry-laravel6-userable/health.svg)

```
[![Health](https://phpackages.com/badges/majebry-laravel6-userable/health.svg)](https://phpackages.com/packages/majebry-laravel6-userable)
```

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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