PHPackages                             ohffs/laravel-admin-middleware - 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. ohffs/laravel-admin-middleware

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

ohffs/laravel-admin-middleware
==============================

Very basic Laravel admin check middleware

0271PHP

Since Nov 21Pushed 7y ago1 watchersCompare

[ Source](https://github.com/ohnotnow/laravel-admin-middleware)[ Packagist](https://packagist.org/packages/ohffs/laravel-admin-middleware)[ RSS](/packages/ohffs-laravel-admin-middleware/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (1)

Laravel Admin Middleware
========================

[](#laravel-admin-middleware)

This is a *very* basic middleware that just adds an 'admin' middleware. All it does is checks if the (default) 'is\_admin' field on the user model is truthy and aborts if not. It's just a bit of code we used to copy from app to app which was getting a bit tiresome.

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

[](#installation)

On Laravel 5.7+ :

```
composer require ohffs/laravel-admin-middleware

```

Usage
-----

[](#usage)

```
Route::get('/admin/report', 'AdminReportController@show')->middleware('admin');

Route::group(['middleware' => 'admin'], function () {
    Route::get('/admin/whatever', 'AdminWhateverController@index');
});

```

Customisation
-------------

[](#customisation)

If you publish the config file via :

```
php artisan vendor:publish ohffs/laravel-admin-middleware

```

The you can change the db field which is checked on the user model by editing `config/admin-middleware.php`.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity39

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/5472be37b2cbedfa6c905bb674cb5780378cf2adcfc47befe01ad7bb4d14f734?d=identicon)[ohnotnow](/maintainers/ohnotnow)

---

Top Contributors

[![ohnotnow](https://avatars.githubusercontent.com/u/6471843?v=4)](https://github.com/ohnotnow "ohnotnow (1 commits)")

### Embed Badge

![Health badge](/badges/ohffs-laravel-admin-middleware/health.svg)

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

###  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)
