PHPackages                             osaris-uk/access - 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. osaris-uk/access

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

osaris-uk/access
================

Role &amp; Permission based access control package for Laravel

2.0(2y ago)01181MITPHPPHP ^7.3 | ^8.0CI failing

Since Jul 22Pushed 2y agoCompare

[ Source](https://github.com/osaris-uk/access)[ Packagist](https://packagist.org/packages/osaris-uk/access)[ Docs](https://github.com/osaris-uk/access)[ RSS](/packages/osaris-uk-access/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (10)Versions (21)Used By (1)

Osaris UK - Access
==================

[](#osaris-uk---access)

Usage
-----

[](#usage)

For Laravel 5.5 - 5.7 use v1.3.2

After running the migrations, you can start using the package by adding the `AccessTrait` to your user model.

```
use OsarisUk\Access\AccessTrait;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use Notifiable, AccessTrait;
}
```

By default all user accounts will be created with the 'user' role, this can be configured in the access config.

You can publish the config file with:

```
php artisan vendor:publish --provider="OsarisUk\Access\AccessServiceProvider" --tag="config"
```

This package will read your default user model from Laravel's auth config `auth.providers.users.model`.

Middleware
----------

[](#middleware)

This package ships with `AccessMiddleware`. This allows you to protect your routes allowing access to users with specific roles:

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

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

You can also allow access to users with specific permissions:

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

Route::group(['middleware' => ['access:user,remove posts']], function () {
    //
});

Route::group(['middleware' => ['access:,edit posts']], function () {
    //
});
```

Blade Directives
----------------

[](#blade-directives)

This package integrates with the default Laravel Blade directive `@can`, this allows you to show content based on a users assigned permission including permissions they have been assigned through a role:

```
@can('edit posts')
    Edit Post
@endcan
```

There is also a `@role` Blade directive included in this package, this allows you to show content based on a users assigned role:

```
@role('moderator')
    Remove Post
@endrole
```

Available Methods
-----------------

[](#available-methods)

```
giveRoles(...$roles)
withdrawRoles(...$roles)
updateRoles(...$roles)
givePermissionTo(...$permissions)
withdrawPermissionTo(...$permissions)
updatePermissions(...$permissions)
hasRole(...$roles)
hasPermissionTo($permission)
```

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity77

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

Recently: every ~62 days

Total

19

Last Release

1089d ago

Major Versions

1.7.2 → 2.02023-07-07

PHP version history (4 changes)v1.0PHP ^7.1.3

1.3.2PHP ^7.0.0

1.6.1PHP ^7.0 | ^8.0

2.0PHP ^7.3 | ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/c655f8ff1687b3f3a9156d917431f14c05dbc187e19e11201348c894afb35045?d=identicon)[osaris-uk](/maintainers/osaris-uk)

---

Top Contributors

[![john-dent](https://avatars.githubusercontent.com/u/24832003?v=4)](https://github.com/john-dent "john-dent (47 commits)")

---

Tags

accessosaris-uk

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/osaris-uk-access/health.svg)

```
[![Health](https://phpackages.com/badges/osaris-uk-access/health.svg)](https://phpackages.com/packages/osaris-uk-access)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k14.1M123](/packages/laravel-pulse)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9772.3M122](/packages/roots-acorn)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45344.0k1](/packages/pressbooks-pressbooks)[api-platform/laravel

API Platform support for Laravel

59156.3k11](/packages/api-platform-laravel)[hasinhayder/tyro

Tyro - The ultimate Authentication, Authorization, and Role &amp; Privilege Management solution for Laravel 12 &amp; 13

6783.6k5](/packages/hasinhayder-tyro)

PHPackages © 2026

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