PHPackages                             milkwood/accessable - 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. milkwood/accessable

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

milkwood/accessable
===================

0.1.6(11y ago)024PHPPHP &gt;=5.4.0

Since Mar 1Pushed 11y ago1 watchersCompare

[ Source](https://github.com/Pab89/Accessable)[ Packagist](https://packagist.org/packages/milkwood/accessable)[ RSS](/packages/milkwood-accessable/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (7)Used By (0)

Accessable
==========

[](#accessable)

Laravel middleware for authfication

### Step 1: Install Through Composer

[](#step-1-install-through-composer)

```
Composer require 'milkwood/accessable'

```

### Step 2: Add The ServiceProvider

[](#step-2-add-the-serviceprovider)

Add the following lines to your service providers i Config/App.php and a CH facade You are here adding both the service provider for CustomHelper which Accessable is dependent on aswell as it's own You are also adding a facade for Customhelper

```
"Milkwood\Accessable\AccesableServiceProvider",
"Milkwood\CustomHelper\CustomHelperServiceProvider",

'CH' => 'Milkwood\CustomHelper\CH',

```

### Step 3: Publish Middleware

[](#step-3-publish-middleware)

Via the console, to publish the middlewhere

```
php artisan vendor:publish

```

You can now use

```
['middleware' => 'auth]

```

In your routes

### Step 4: Add Actions To Check For

[](#step-4-add-actions-to-check-for)

Add the rules you got for your user

```
protected $keysToCheckFor = ['reqRoles','forbiddenRoles','minAccessLevel','maxAccessLevel','moduleToAccess'];

```

### Step 5: Add The Trait To Class

[](#step-5-add-the-trait-to-class)

Add the accessable trait to the class, example the user

```
use Milkwood\Accessable\Accessable;

class ExampleClass{

	use Accessable;

}

```

### Step 6: Create The Rules

[](#step-6-create-the-rules)

See examples below of rules on the usertype below

```
// Requirement functions

public function reqRoles($roles){

	$roles = explode('|',$roles);
	if( in_array( $this->name , $roles) ){
		return true;
	}

	$this->error = 'Din bruger type har ikke adgang til den pågældende side';
	return false;

}

public function forbiddenRoles($roles){

	$roles = explode('|',$roles);
	if( ! in_array( $this->name , $roles) ){
		return true;
	}

	$this->error = 'Din bruger type er restrikteret fra den pågældende side';
	return false;

}

public function minAccessLevel($accessLevel){

	if( $this->access_level >= $accessLevel){
		return true;
	}

	$this->error = 'Din brugertype har for lav access til den pågældende side';
	return false;

}

public function maxAccessLevel($accessLevel){

	if( $this->access_level error = 'Din brugertype har for høj access til den pågældende side';
	return false;

}

```

See below for an example of company requirering modules

```
public function moduleToAccess($moduleName){

	$modulesCompanyHasAccessTo = $this->modules->lists('name');

	if( in_array($moduleName, $modulesCompanyHasAccessTo)){
		return true;
	}

	$this->error = 'Din virksomhed har ikke adgang til dette modul';
	return false;

}

```

See below how to send of the request to another class

```
public function reqRoles($roles){

	return $this->sendOfAccess('userType', [ __FUNCTION__ => $roles]);

}

public function forbiddenRoles($roles){

	return $this->sendOfAccess('userType', [ __FUNCTION__ => $roles]);

}

public function minAccessLevel($accessLevel){

	return $this->sendOfAccess('userType', [ __FUNCTION__ => $accessLevel]);

}

public function maxAccessLevel($accessLevel){

	return $this->sendOfAccess('userType', [ __FUNCTION__ => $accessLevel]);

}

public function moduleToAccess($moduleName){

	return $this->sendOfAccess('company', [ __FUNCTION__ => $moduleName]);

}

```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

Every ~2 days

Total

6

Last Release

4135d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4909dcf34c2e9826ff8a651aa85d39fd833b75481df41f2173724c18972516d8?d=identicon)[Pab89](/maintainers/Pab89)

---

Top Contributors

[![Pab89](https://avatars.githubusercontent.com/u/2759517?v=4)](https://github.com/Pab89 "Pab89 (13 commits)")

### Embed Badge

![Health badge](/badges/milkwood-accessable/health.svg)

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

###  Alternatives

[directorytree/ldaprecord-laravel

LDAP Authentication &amp; Management for Laravel.

5752.3M18](/packages/directorytree-ldaprecord-laravel)[illuminate/auth

The Illuminate Auth package.

10528.2M1.2k](/packages/illuminate-auth)[althinect/filament-spatie-roles-permissions

3481.1M10](/packages/althinect-filament-spatie-roles-permissions)[hasinhayder/tyro

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

6804.7k6](/packages/hasinhayder-tyro)[masterix21/laravel-licensing

Laravel licensing package with polymorphic assignment to any model, activation keys, expirations/renewals, and seat control via LicenseUsage. Supports offline verification with public-key–signed tokens, a CLI to generate/rotate/revoke keys, and an extensible architecture via config and contracts.

1563.1k4](/packages/masterix21-laravel-licensing)

PHPackages © 2026

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