PHPackages                             mvd81/laravel-is-admin - 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. mvd81/laravel-is-admin

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

mvd81/laravel-is-admin
======================

Laravel package, simple functionality to set a user as admin without an advanced role system

3.3(1y ago)1189MITPHPPHP ^8.2CI passing

Since Jun 11Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mvd81/laravel-is-admin)[ Packagist](https://packagist.org/packages/mvd81/laravel-is-admin)[ RSS](/packages/mvd81-laravel-is-admin/feed)WikiDiscussions master Synced today

READMEChangelog (6)Dependencies (4)Versions (6)Used By (0)

Laravel Is Admin
================

[](#laravel-is-admin)

[![Build Status](https://github.com/mvd81/laravel-is-admin/actions/workflows/tests.yml/badge.svg)](https://github.com/mvd81/laravel-is-admin/actions)[![Total Downloads](https://camo.githubusercontent.com/8195074084d1f9573c115590a66f467f81022f39729a1e224bdc3e4384a66238/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d766438312f6c61726176656c2d69732d61646d696e)](https://packagist.org/packages/mvd81/laravel-is-admin)[![Latest Stable Version](https://camo.githubusercontent.com/c9f2e71bbd79c05279a9fe99058cd945b1fe85cf37c6b5396d7dad850698a6fc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d766438312f6c61726176656c2d69732d61646d696e)](https://packagist.org/packages/mvd81/laravel-is-admin)[![License](https://camo.githubusercontent.com/724431b8b32668a6e1445f8aeec427c57f88930df7799f2c97930149564989fe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d766438312f6c61726176656c2d69732d61646d696e)](https://packagist.org/packages/mvd81/laravel-is-admin)

Introduction
------------

[](#introduction)

Laravel package to extend your Laravel application with a simple admin permission functionality, with:

- Migration file to set a user as admin
- Middleware
- Blade directive
- Artisan command to see who is an admin
- Option to set user with ID 1 as super admin

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

[](#installation)

1. `composer require mvd81/laravel-is-admin`
2. Run `php artisan migrate`to create the 'is\_admin' column in the `users` table
3. Import the trait in the User model

```
use Mvd81\LaravelIsAdmin\Traits\isAdmin;
```

4. Use the trait in the User model

```
class User extends Authenticatable
{
    use isAdmin;
    ...
```

5. Add `is_admin` to the `$fillable` array in the User model

How to use
----------

[](#how-to-use)

You can set a 'normal' user as admin by setting the database column `is_admin` to `1 `, in database table `users`.

Or in the code

### Make admin

[](#make-admin)

```
$user = User::find(ID);
$user->makeAdmin();
```

### Undo admin

[](#undo-admin)

```
$user = User::find(ID);
$user->undoAdmin();
```

Super admin
-----------

[](#super-admin)

It is possible to use user with ID 1 as admin without setting the 'is\_admin' column to 1.
First you need to publish the config file.

- `php artisan vendor:publish`
- Choose the option: Provider: Mvd81\\LaravelIsAdmin\\LaravelIsAdminServiceProvider

Now in `config/is_admin.php` set 'use\_super\_admin' to true.

```
'use_super_admin' => true,
```

Middleware
----------

[](#middleware)

There is a `IsAdmin` middleware to use in your routes.

Example:

```
Route::get('admin-page')->middleware('IsAdmin');
```

Blade directive
---------------

[](#blade-directive)

Partial template/layout in your Blade view files only for admins?
You can use this Blade directive

```
@isAdmin()
    I am an admin
@endisAdmin
```

Who is an admin?
----------------

[](#who-is-an-admin)

You can enter an artisan command to see who is an admin.

```
php artisan user:who-is-admin
```

Uninstall
---------

[](#uninstall)

1. `composer remove mvd81/laravel-is-admin`
2. Remove the config file `config/is_admin.php`
3. Remove the database `is_admin` column in table `users`
4. If you used the blade `@isAdmin()` directive, remove them
5. Remove the `is_admin` middleware from your routes

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance48

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity68

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

Total

5

Last Release

388d ago

Major Versions

v1.0 → v2.02022-03-02

v2.0 → v3.12024-12-13

PHP version history (3 changes)v2.0PHP ^7.4|^8.0

v3.1PHP ^8.1

v3.2PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/256c4b46470c11d0339d18a09afa597ca6134acedfa75060ae8d790f05ee502d?d=identicon)[mvd81](/maintainers/mvd81)

---

Top Contributors

[![mvd81](https://avatars.githubusercontent.com/u/5435962?v=4)](https://github.com/mvd81 "mvd81 (34 commits)")

---

Tags

laravellaravel-adminLaravel admin roleLaravel is admin

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mvd81-laravel-is-admin/health.svg)

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

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[socialiteproviders/manager

Easily add new or override built-in providers in Laravel Socialite.

42442.0M544](/packages/socialiteproviders-manager)[directorytree/ldaprecord-laravel

LDAP Authentication &amp; Management for Laravel.

5682.0M15](/packages/directorytree-ldaprecord-laravel)[josiasmontag/laravel-recaptchav3

Recaptcha V3 for Laravel package

2641.6M2](/packages/josiasmontag-laravel-recaptchav3)[olssonm/l5-very-basic-auth

Laravel stateless HTTP basic auth without the need for a database

1662.5M1](/packages/olssonm-l5-very-basic-auth)[scaler-tech/laravel-saml2

SAML2 Service Provider integration for Laravel applications, based on OneLogin toolkit

2737.5k](/packages/scaler-tech-laravel-saml2)

PHPackages © 2026

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