PHPackages                             snoeren-development/laravel-admin-users - 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. snoeren-development/laravel-admin-users

ActiveLaravel-package[Admin Panels](/categories/admin)

snoeren-development/laravel-admin-users
=======================================

Define and check for admin users in your application!

v1.10.1(10mo ago)210.6kMITPHPPHP ^8.2CI passing

Since Feb 17Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/snoeren-development/laravel-admin-users)[ Packagist](https://packagist.org/packages/snoeren-development/laravel-admin-users)[ Fund](https://bunq.me/SnoerenDevelopment)[ RSS](/packages/snoeren-development-laravel-admin-users/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (26)Used By (0)

Laravel Admin Users
===================

[](#laravel-admin-users)

[![Latest version on Packagist](https://camo.githubusercontent.com/0ad926c27056507ced55fe39ea21e5bf8178d8c018d0683bd28a96826cd476e8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736e6f6572656e2d646576656c6f706d656e742f6c61726176656c2d61646d696e2d75736572732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/snoeren-development/laravel-admin-users)[![Software License](https://camo.githubusercontent.com/20f5a0f22fd3b74ecb3bde14a0a61bcbfce0753064c7afea1be2ad713d099fb8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f736e6f6572656e2d646576656c6f706d656e742f6c61726176656c2d61646d696e2d75736572733f7374796c653d666c61742d737175617265)](LICENSE)[![Build status](https://camo.githubusercontent.com/38ea49abbdc0b4dff89b33d84a4355387f1a7e927e7e3b41713be03a7fc76be6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f736e6f6572656e2d646576656c6f706d656e742f6c61726176656c2d61646d696e2d75736572732f7068702e796d6c3f6272616e63683d6d61696e267374796c653d666c61742d737175617265)](https://github.com/snoeren-development/laravel-admin-users/actions)[![Downloads](https://camo.githubusercontent.com/9bbe4f57d67fa112043c6cd3b60398fed51fc00807bd4cf17d746aafad46f066/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736e6f6572656e2d646576656c6f706d656e742f6c61726176656c2d61646d696e2d75736572733f7374796c653d666c61742d737175617265)](https://packagist.org/packages/snoeren-development/laravel-admin-users)

This small package adds a configuration and user model trait to define administrators within your application.

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

[](#installation)

Install the package using Composer:

```
composer require snoeren-development/laravel-admin-users
```

### Requirements

[](#requirements)

This package requires at least PHP 8.3 and Laravel 10.

Usage
-----

[](#usage)

Add the `SnoerenDevelopment\AdminUsers\Adminable` trait to your user model and define administrator users using the `ADMINS=` environment variable. The variable should contain a comma separated list of email addresses of your application administrators.

### Using the middleware

[](#using-the-middleware)

This package comes with middleware. This middleware checks if the user is an administrator. If not, the middleware throws a 401 unauthorised exception.

Add the middleware to your `$routeMiddleware` list in the HTTP kernel to use.

```
// Kernel.php
'admin' => \SnoerenDevelopment\AdminUsers\AdminMiddleware::class,
```

### Grant administrators all permissions

[](#grant-administrators-all-permissions)

```
// AuthServiceProvider.php

use Illuminate\Support\Facades\Gate;

public function boot()
{
    $this->registerPolicies();

    Gate::before(function ($user, $ability) {
        if ($user->isAdmin()) {
            return true;
        }
    });
}
```

### Using the gate via Blade

[](#using-the-gate-via-blade)

```
{{-- Using the gate via the can-statement. --}}
@can('admin')
    The current user is an admin!
@else
    The current user is not an admin!
@endcan

{{-- Using the custom if-statement --}}
@admin
    The current user is an admin!
@else
    The current user is not an admin!
@endadmin
```

### Publishing the configuration file

[](#publishing-the-configuration-file)

You can publish the configuration file to your project using `php artisan vendor:publish`. Then select the admin package.

### Using the MySQL driver

[](#using-the-mysql-driver)

Publish and run the migration or manually add the `is_admin` column to your users table. Set the driver to `mysql` in your `.env` file using `ADMINS_DRIVER=mysql`.

Testing
-------

[](#testing)

```
composer test
```

Credits
-------

[](#credits)

- [Michael Snoeren](https://github.com/MSnoeren)
- [All Contributors](https://github.com/snoeren-development/laravel-admin-users/graphs/contributors)

License
-------

[](#license)

The MIT license. See [LICENSE](LICENSE) for more information.

###  Health Score

50

—

FairBetter than 96% of packages

Maintenance75

Regular maintenance activity

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 88.1% 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 ~77 days

Recently: every ~166 days

Total

22

Last Release

301d ago

PHP version history (5 changes)v1.0.0PHP ^7.3|^8.0

v1.3.0PHP ^7.4|^8.0

v1.5.0PHP ^8.0

v1.7.0PHP ^8.1

v1.8.0PHP ^8.2

### Community

Maintainers

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

---

Top Contributors

[![MSnoeren](https://avatars.githubusercontent.com/u/3404401?v=4)](https://github.com/MSnoeren "MSnoeren (52 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")

---

Tags

adminlaravellaravel-packagemiddlewarephpmiddlewarelaraveladmin

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

### Embed Badge

![Health badge](/badges/snoeren-development-laravel-admin-users/health.svg)

```
[![Health](https://phpackages.com/badges/snoeren-development-laravel-admin-users/health.svg)](https://phpackages.com/packages/snoeren-development-laravel-admin-users)
```

###  Alternatives

[slowlyo/owl-admin

基于 laravel、amis 开发的后台框架~

61214.2k26](/packages/slowlyo-owl-admin)[sebastienheyd/boilerplate

Laravel Boilerplate based on AdminLTE 3 with blade components, user management, roles, permissions, logs viewer, ...

28618.2k3](/packages/sebastienheyd-boilerplate)[lokielse/laravel-admin-generator

An Admin Panel Generator for Laravel 5

712.0k](/packages/lokielse-laravel-admin-generator)[serverfireteam/blog

A nice blog system with laravel and laravelpanel

523.1k](/packages/serverfireteam-blog)

PHPackages © 2026

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