Search by

saeedaz19 / authorizo

A lightweight role and permission management package for Laravel, with a ready-to-use admin UI for creating roles and assigning them to users.

Maintainers

Package info

github.com/S-A-A-H2003/authorizo

Homepage

Language:Blade

pkg:composer/saeedaz19/authorizo

Transparency log

Fund package maintenance!

saeedaz19

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-09-03 11:54 UTC

This package is auto-updated.

Last update: 2026-09-03 11:56:07 UTC


README

Authorizo

Packagist PHP from Packagist Laravel versions GitHub Workflow Status (main) Total Downloads

Authorizo is a lightweight role and permission management package for Laravel. It provides database tables, a role relationship for your user model, an authorization middleware, an installer command, and a simple admin UI for managing roles and assigning them to users.

Requirements

  • PHP 8.3 or higher
  • Laravel 12 or 13

Installation

Install the package via Composer:

composer require saeedaz19/authorizo

Publish and run the migrations:

php artisan vendor:publish --tag="authorizo-migrations"
php artisan migrate

Add the HasAuthorizo trait to your user model:

use Authorizo\Authorizo\Traits\HasAuthorizo;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use HasAuthorizo;
}

Run the installer command:

php artisan authorizo:install

The installer scans routes that use the authorizo middleware, creates permissions from their controller and action names, and creates the default admin and user roles.

Configuration

You may publish the configuration file:

php artisan vendor:publish --tag="authorizo-config"

Admin UI

Authorizo registers its admin routes automatically under the admin prefix:

/admin/authorizo
/admin/role
/admin/role/create
/admin/assign

The package also registers the authorizo middleware alias. Routes protected by this middleware are checked against the authenticated user's role permissions.

use App\Http\Controllers\PostController;
use Illuminate\Support\Facades\Route;

Route::middleware(['web', 'auth', 'authorizo'])->group(function () {
    Route::get('/posts', [PostController::class, 'index']);
    Route::post('/posts', [PostController::class, 'store']);
});

For a controller action such as PostController@index, Authorizo looks for a permission with the slug:

post.index

Publishing Resources

Publish all package resources:

php artisan vendor:publish --tag="authorizo"

Or publish only what you need:

php artisan vendor:publish --tag="authorizo-config"
php artisan vendor:publish --tag="authorizo-migrations"
php artisan vendor:publish --tag="authorizo-views"
php artisan vendor:publish --tag="authorizo-lang"

Testing

Run the package test suite:

composer test

You may also run the checks individually:

composer analyse
composer lint:check
composer test:types
composer test:unit

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Thank you for considering contributing to Authorizo! Please review our contributing guide to get started.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

Authorizo is open-sourced software licensed under the MIT license.