PHPackages                             cloudoki/guardian - 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. cloudoki/guardian

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

cloudoki/guardian
=================

Internal Authorisation scopes for Laravel

v0.6.0(9y ago)03091MITPHPPHP &gt;=5.4.0

Since Jan 28Pushed 9y agoCompare

[ Source](https://github.com/Cloudoki/Guardian)[ Packagist](https://packagist.org/packages/cloudoki/guardian)[ Docs](http://github.com/Cloudoki/Guardian)[ RSS](/packages/cloudoki-guardian/feed)WikiDiscussions master Synced 1mo ago

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

Guardian
========

[](#guardian)

As extension to the **[Oauth2 Stack](http://blog.cloudoki.com/oauth2-stack/)**, Guardian provides internal Authorisation scopes for Laravel.

This package is usable in multiple Laravel versions. Right now, however, the Guardian package is only tested in Laravel 4.2 with Eloquent.

\####Dependencies **Oauth2-Stack** - Guardian uses the **Account** and **User** models next to the **Oauth2Verifier** class.

**Except-io-nal** - The Cloudoki PHP Exception extensions are used to throw manageable errors when authorisations are not valid.

Install Laravel 5.2 MQ
----------------------

[](#install-laravel-52-mq)

Add our package as requirement in your composer file.

```
$ nano composer.json

```

```
"require": {
    "laravel/framework": "5.2.*",
    "cloudoki/guardian": "dev-master"
    ...

```

You might want to run an update. If something goes wrong, change your `minimum-stability` to `dev` in the `composer.json` file, for now.

```
$ composer update

```

The package is now installed in the project `vendor` folder. You'll need to register the package provider in your app config file next. Since Laravel 5, the Illuminate\\Form is no longer part of the core pack, so you should register it as well.

```
$ nano config/app.php

```

```
	'providers' => [
		...
		Collective\Html\HtmlServiceProvider::class,
		Cloudoki\OaStack\OaStackServiceProvider::class,
		Cloudoki\Guardian\GuardianServiceProvider::class
    ],

	'aliases' => [
		...
        'Form'		=> Collective\Html\FormFacade::class,
        'Guardian'	=> Cloudoki\Guardian\GuardianFacade::class,
        'HTML'		=> Collective\Html\HtmlFacade::class,
    ],

```

### DB Migration

[](#db-migration)

Of course, your backend workers need db access for validation. It goes something like this:

### DB Seeds

[](#db-seeds)

In order to create the roles required by the Guardian package itself, run the following command from the root path of the app that uses this package.

```
php artisan db:seed --class="Database\Seeds\GuardianRolesSeeder"

```

Usage
-----

[](#usage)

#### Oauth2 Stack

[](#oauth2-stack)

Please [dig into](http://blog.cloudoki.com/oauth2-stack/) the Oauth2 Stack documentation before implementing Guardian.

#### Access Token

[](#access-token)

The **access token** is requested as `Input` parameter, in respect to the Oauth2 Stack and **MQ alignment**. In a production level API request however, the access token should ALWAYS be placed in the Authorisation header of the request.

#### Management REST Endpoints

[](#management-rest-endpoints)

The Guardian package provides REST API endpoints to view and manage Rolegroups and Roles. Detailed documentation in [this wiki page](https://github.com/Cloudoki/Guardian/wiki/Management-Endpoints).

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 73.8% 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 ~63 days

Total

5

Last Release

3508d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/46a1f5fb785419ecea5d467ae6b13665998c2850da3cc2c9d5b294021e4d5ddb?d=identicon)[koenbetsens](/maintainers/koenbetsens)

---

Top Contributors

[![koenbetsens](https://avatars.githubusercontent.com/u/3852397?v=4)](https://github.com/koenbetsens "koenbetsens (31 commits)")[![tiagoalves](https://avatars.githubusercontent.com/u/215495?v=4)](https://github.com/tiagoalves "tiagoalves (11 commits)")

---

Tags

laravelauthorisation

### Embed Badge

![Health badge](/badges/cloudoki-guardian/health.svg)

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

###  Alternatives

[awes-io/auth

Laravel Authentication package with built-in two-factor (Authy) and social authentication (Socialite).

3826.7k1](/packages/awes-io-auth)[arcanedev/laravel-auth

Laravel Authorization package.

294.8k1](/packages/arcanedev-laravel-auth)[martbock/laravel-diceware

Diceware Passphrase Generator for Laravel

3264.7k](/packages/martbock-laravel-diceware)[orchestra/auth

Auth Component for Orchestra Platform

24108.5k3](/packages/orchestra-auth)[ingria/laravel-x509-auth

Laravel 5 Client Certificate auth middleware

375.6k](/packages/ingria-laravel-x509-auth)

PHPackages © 2026

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