PHPackages                             mohit/usertype - 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. mohit/usertype

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

mohit/usertype
==============

Laravel User types - Admin/User

v1.0(7y ago)17PHPPHP ^7.0

Since Jan 2Pushed 7y ago1 watchersCompare

[ Source](https://github.com/mohitmehta1996/laravel-user-types)[ Packagist](https://packagist.org/packages/mohit/usertype)[ RSS](/packages/mohit-usertype/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Laravel User types - Admin/User
===============================

[](#laravel-user-types---adminuser)

This package create user types like Simple user, Admin and Super Admin.

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

[](#installation)

You can install the package via composer:

```
composer require mohit/usertype
php artisan vendor:publish --provider="mohit\usertype\UsertypeProvider"
php artisan migrate
```

Create Admin User
-----------------

[](#create-admin-user)

```
php artisan create:admin
```

It will ask you to enter name, email and password. Then you can login with entered email and password.

Create Super Admin User
-----------------------

[](#create-super-admin-user)

Super Admin user have roles of accessing admin pages as well as user pages.

```
php artisan create:super
```

It will ask you to enter name, email and password. Then you can login with entered email and password.

Usage
-----

[](#usage)

This package creates and registeres new middleware which you can use in routes file. You can assign middleware to either group of routes or individual routes.

For admin,

```
Route::group(['middleware' => 'authorize:admin'], function(){
    //
});
```

For user,

```
Route::group(['middleware' => 'authorize:user'], function(){
    //
});
```

For super admin,

```
Route::group(['middleware' => 'authorize:admin|user'], function(){
    //
});
```

Using In Blades
---------------

[](#using-in-blades)

```
@if(auth()->user()->type == 'admin')
  //
@endif
```

Styling Unauthorized page
-------------------------

[](#styling-unauthorized-page)

When any user try to access page for which he is not authorized then it will redirect him to unauthorized page. This page follow bootstrap structure. You can style this page by creating new css file under 'public/css/unauthorized.css'.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

2691d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1c1e7cbc515701ec6aacb5892fb6844c62fed4895b10aff7939b884a70c3d950?d=identicon)[mohitmehta](/maintainers/mohitmehta)

---

Top Contributors

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

---

Tags

adminlaravellaravel5superadminuseruserroleusertypetypelaravelaclpermissionmohit

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mohit-usertype/health.svg)

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

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k89.8M1.0k](/packages/spatie-laravel-permission)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[casbin/laravel-authz

An authorization library that supports access control models like ACL, RBAC, ABAC in Laravel.

324339.9k4](/packages/casbin-laravel-authz)[yajra/laravel-acl

Laravel ACL is a simple role, permission ACL for Laravel Framework.

112103.9k1](/packages/yajra-laravel-acl)[codebot/entrust

This package provides a flexible way to add Role-based Permissions to Laravel

1596.6k](/packages/codebot-entrust)[wnikk/laravel-access-rules

Simple system of ACR (access control rules) for Laravel, with roles, groups, unlimited inheritance and possibility of multiplayer use.

103.6k1](/packages/wnikk-laravel-access-rules)

PHPackages © 2026

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