PHPackages                             novatopro/lrp - 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. novatopro/lrp

ActiveLibrary

novatopro/lrp
=============

This is my package lrp

0.0.3(3y ago)0112[1 PRs](https://github.com/novatopro/lrp/pulls)MITPHPPHP ^8.1

Since May 9Pushed 2y agoCompare

[ Source](https://github.com/novatopro/lrp)[ Packagist](https://packagist.org/packages/novatopro/lrp)[ Docs](https://github.com/novatopro/lrp)[ RSS](/packages/novatopro-lrp/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (9)Versions (5)Used By (0)

This is a basic package for laravel roles and permissions
=========================================================

[](#this-is-a-basic-package-for-laravel-roles-and-permissions)

[![Latest Version on Packagist](https://camo.githubusercontent.com/6f389df4c5bf5c292cf8968af6caa69f6b79f4819d232fbaec60dc3ac74caad5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6f7661746f70726f2f6c72702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/novatopro/lrp)[![GitHub Tests Action Status](https://camo.githubusercontent.com/b5a5bf6d610a2dfff06e2e17ee872eb3a3c563f40ff87919f66e969bf75c5dc4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6e6f7661746f70726f2f6c72702f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/novatopro/lrp/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/3ca134efdaa93584f1dd5a4009a783aa7e09c130890165e2a9b17560b6188b22/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6e6f7661746f70726f2f6c72702f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/novatopro/lrp/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/f1c990d07ea3875fcdf11e33f6fcc98312c13b6a2aff85b3fa4ac40f0f183433/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e6f7661746f70726f2f6c72702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/novatopro/lrp)

This package provide basic roles and permissions, this readme.md contains examples of usage.

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

[](#installation)

You can install the package via composer:

```
composer require novatopro/lrp
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="lrp-migrations"
php artisan migrate
```

Usage
-----

[](#usage)

### Update user model relationship

[](#update-user-model-relationship)

> app\\Models\\User.php

```
use NovatoPro\Lrp\Traits\UserLrp;

class User extends Authenticatable
{
    use UserLrp;
}
```

### Update boot method in AuthServiceProvider

[](#update-boot-method-in-authserviceprovider)

> app\\Providers\\AuthServiceProvider.php

```
Gate::define('access', function (User $user, ...$permissions) {
    return $user->hasPermissions($permissions);
});
```

### Examples

[](#examples)

```
use NovatoPro\Lrp\Models\Role;
use NovatoPro\Lrp\Models\Permission;
// Example user credentials
$credentials = [
    'name'=>'Example User',
    'email'=>'developer.user@example.com',
    'password'=>'password'
];

// Create example user
$user = User::updateOrCreate(['email'=>$credentials['email']],['name'=>$credentials['name'],'password'=>Hash::make($credentials['password'])]);

// Create example role
$role = Role::updateOrCreate(['name'=>'Developer Features','slug'=>'developer-features']);

// Create example permission
$permission = Permission::updateOrCreate(['name'=>'Dev','slug'=>'dev','description'=>'Can see features in development']);

// Add permision to role without remove, without duplicate
$role->permissions()->syncWithoutDetaching($permission->id);

// Add role to user without remove, without duplicate
$user->roles()->syncWithoutDetaching($role->id);

// Check permissions in controllers
if($user->can('access', ['developer','dev','develop'])){
    // Can see features in development
}else{
    // Can't see features in development
}

// Authorize with permissions
use Illuminate\Support\Facades\Gate;
Gate::authorize('access','dev');
```

```
// Check permissions in blade
@can('access', ['developer','dev','develop'])
    Can see features in development
@else
    Can't see features in development
@endcan
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 61.5% 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 ~0 days

Total

3

Last Release

1095d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ef2289677b0a7bfb59833f02622b0d00e61383f69212c6b175db327f0d82d62d?d=identicon)[np](/maintainers/np)

---

Top Contributors

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (332 commits)")[![mvdnbrk](https://avatars.githubusercontent.com/u/802681?v=4)](https://github.com/mvdnbrk "mvdnbrk (46 commits)")[![pforret](https://avatars.githubusercontent.com/u/474312?v=4)](https://github.com/pforret "pforret (16 commits)")[![novatopro](https://avatars.githubusercontent.com/u/121565608?v=4)](https://github.com/novatopro "novatopro (15 commits)")[![sebastiandedeyne](https://avatars.githubusercontent.com/u/1561079?v=4)](https://github.com/sebastiandedeyne "sebastiandedeyne (14 commits)")[![Nielsvanpach](https://avatars.githubusercontent.com/u/10651054?v=4)](https://github.com/Nielsvanpach "Nielsvanpach (13 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (13 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (10 commits)")[![AdrianMrn](https://avatars.githubusercontent.com/u/12762044?v=4)](https://github.com/AdrianMrn "AdrianMrn (8 commits)")[![AlexVanderbist](https://avatars.githubusercontent.com/u/6287961?v=4)](https://github.com/AlexVanderbist "AlexVanderbist (7 commits)")[![riasvdv](https://avatars.githubusercontent.com/u/3626559?v=4)](https://github.com/riasvdv "riasvdv (7 commits)")[![cetiia](https://avatars.githubusercontent.com/u/114244531?v=4)](https://github.com/cetiia "cetiia (6 commits)")[![patinthehat](https://avatars.githubusercontent.com/u/5508707?v=4)](https://github.com/patinthehat "patinthehat (5 commits)")[![irfanm96](https://avatars.githubusercontent.com/u/42065936?v=4)](https://github.com/irfanm96 "irfanm96 (5 commits)")[![IGedeon](https://avatars.githubusercontent.com/u/694313?v=4)](https://github.com/IGedeon "IGedeon (4 commits)")[![crynobone](https://avatars.githubusercontent.com/u/172966?v=4)](https://github.com/crynobone "crynobone (4 commits)")[![yaroslawww](https://avatars.githubusercontent.com/u/23663794?v=4)](https://github.com/yaroslawww "yaroslawww (3 commits)")[![jessarcher](https://avatars.githubusercontent.com/u/4977161?v=4)](https://github.com/jessarcher "jessarcher (3 commits)")[![koossaayy](https://avatars.githubusercontent.com/u/6431084?v=4)](https://github.com/koossaayy "koossaayy (3 commits)")[![medilies](https://avatars.githubusercontent.com/u/35309918?v=4)](https://github.com/medilies "medilies (3 commits)")

---

Tags

laravelNovatoProlrp

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/novatopro-lrp/health.svg)

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

###  Alternatives

[leandrocfe/filament-apex-charts

Apex Charts integration for Filament PHP.

4861.2M8](/packages/leandrocfe-filament-apex-charts)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[spatie/livewire-filepond

Upload files using Filepond in Livewire components

306452.7k3](/packages/spatie-livewire-filepond)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[codebar-ag/laravel-filament-json-field

A Laravel Filament JSON Field integration with CodeMirror support

1124.1k](/packages/codebar-ag-laravel-filament-json-field)

PHPackages © 2026

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