italofantone/role-ladder

A Laravel package to manage roles with a hierarchical structure, represented as a clear and intuitive ladder.

v1.0.1 2025-01-08 20:00 UTC

This package is auto-updated.

Last update: 2025-04-08 20:26:17 UTC


README

A Laravel package to manage roles with a hierarchical structure, represented as a clear and intuitive ladder.

⚠️ This code was used for educational purposes [...]

Installation

You can install the package via composer. Run the following command:

composer require italofantone/role-ladder

Usage

<?php

use Illuminate\Support\Facades\Route;
use Italofantone\RoleLadder\Http\Middleware\RoleLadderMiddleware;

Route::middleware('auth:sanctum')->group(function () {
    Route::middleware(RoleLadderMiddleware::class.':admin')->group(function () {
        Route::get('/test-role-admin', function () {
            return 'This route is only for admins!';
        });
    });
});

To publish the configuration files for Role Ladder, run the following artisan command:

php artisan vendor:publish --tag=role-ladder-config

Contact

Donations

If you find this project useful and would like to support its development, you can make a donation via PayPal:

Thank you for your support!