PHPackages                             journeycx/authuser - 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. journeycx/authuser

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

journeycx/authuser
==================

AuthUser - Laravel Routes Authorization Library

05PHP

Since May 12Pushed 2y ago1 watchersCompare

[ Source](https://github.com/JourneyCX/AuthUser)[ Packagist](https://packagist.org/packages/journeycx/authuser)[ RSS](/packages/journeycx-authuser/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

**AuthUser**
============

[](#authuser)

---

AuthUser is flexible authorization system for Laravel, It checks the `route` permission to access a certain portion of the site or application. To add Permissions `User-based`, `Role-based`, `Conditionally`. It uses `authority.checkpost` middleware for filter permission of current accessing route, Under this middleware checked every permission of the user login.

**Installation**
----------------

[](#installation)

Require this package in your `composer.json` or install it by running:

```
    composer require journeycx/authuser
```

Now, insert this line into your `config/app.php` under the `provider` array.

```
    journeycx\AuthUser\AuthUser::class
```

Now, run this command after that `config/authuser.php` and `app/Http/Middleware/AuthUserCheckpostMiddleware.php` files are publish.

```
    php artisan vendor:publish  --tag="authuser"
```

Now, insert this line into your `app/Http/Kernel.php` under the `$routeMiddleware` array.

```
    'authority.checkpost'  => \App\Http\Middleware\AuthUserCheckpostMiddleware::class
```

Use `authority.checkpost` middleware for handle permission base routes.

```
    Route::group(['middleware' => 'authority.checkpost'], function () {
        // Place all those routes here which needs authentication and authorization.
    });
```

Now, the basic setup is ready you need to configure rules of permissions using `config/authuser`.

**Configuration**
-----------------

[](#configuration)

The structure of permissions given below, but it's highly recommended to read more on [docs](https://journeycx.github.io/AuthUser/Sample_Structure)`.

```
    [
        'allow' => ['*'], // Allowed permission to user. Priority is less than deny.
        'deny'  => ['temp1'], // Deny permission to user. Priority is higher than allow.
    ]

    canAccess('temp1');
    // false
```

**Usage - Helpers**
-------------------

[](#usage---helpers)

- **##### canAccess($accessId = null);

    [](#canaccessaccessid--null)** Check the access, By default it check current route and return response in **boolean** value.

```
    canAccess('temp1');
    // true or false
```

- **##### canPublicAccess($accessId = null); - `Authentication not required`

    [](#canpublicaccessaccessid--null---authentication-not-required-)** Check the public access, By default it check current route and return response in **boolean** value.

```
    canPublicAccess();
    // true or false
```

**Usage - Facade**
------------------

[](#usage---facade)

- **##### AuthUser::check($accessId = null, $requestForUserId = null)

    [](#authusercheckaccessid--null-requestforuserid--null)** Check the access of `$accessId`, By default it check current route and return response in **boolean** value, And it can check access of perticular user by passing user id `($requestForUserId)` parameter.

```
    AuthUser::check('temp1');
    // true or false
```

- **##### AuthUser::isPublicAccess($accessId = null); - `Authentication not required`

    [](#authuserispublicaccessaccessid--null---authentication-not-required)** Check the access of `$accessId`, By default it check current route and return response in **boolean** value.

```
    AuthUser::isPublicAccess('temp1');
    // true or false
```

**Usage - Directives**
----------------------

[](#usage---directives)

- **##### @canAccess($accessId = null);

    [](#canaccessaccessid--null-1)** Check the access, By default it check current route and return response in **boolean** value.

```
    @canAccess()
       // your logic here.
    @endAccess;
```

- **##### @canPublicAccess($accessId = null); - `Authentication not required`

    [](#canpublicaccessaccessid--null---authentication-not-required)** Check the public access, By default it check current route and return response in **boolean** value.

```
    @canPublicAccess()
       // your logic here.
    @endAccess;
```

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity18

Early-stage or recently created project

 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/00ef01073ddb843b97baaf0ea089eb0ea2fe440a6190d89e0ca9828220964884?d=identicon)[Gr8Dan](/maintainers/Gr8Dan)

---

Top Contributors

[![JourneyCX](https://avatars.githubusercontent.com/u/106874595?v=4)](https://github.com/JourneyCX "JourneyCX (3 commits)")

### Embed Badge

![Health badge](/badges/journeycx-authuser/health.svg)

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

###  Alternatives

[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)[illuminate/auth

The Illuminate Auth package.

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

A flexible, driver based Acl package for PHP 5.4+

870304.7k2](/packages/beatswitch-lock)[amocrm/amocrm-api-library

amoCRM API Client

182728.5k6](/packages/amocrm-amocrm-api-library)[vonage/jwt

A standalone package for creating JWTs for Vonage APIs

424.1M4](/packages/vonage-jwt)

PHPackages © 2026

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