PHPackages                             georgebohnisch/redoubt-plus - 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. georgebohnisch/redoubt-plus

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

georgebohnisch/redoubt-plus
===========================

A resource-level ACL for Laravel 4.

1.3(12y ago)246MITPHPPHP &gt;=5.3.0

Since Sep 17Pushed 11y ago1 watchersCompare

[ Source](https://github.com/georgebohnisch/redoubt-plus)[ Packagist](https://packagist.org/packages/georgebohnisch/redoubt-plus)[ Docs](http://github.com/greggilbert/redoubt)[ RSS](/packages/georgebohnisch-redoubt-plus/feed)WikiDiscussions master Synced 1mo ago

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

Redoubt+
========

[](#redoubt)

A fork of [greggilbert/redoubt](https://github.com/greggilbert/redoubt) with a few useful additions.

A resource-level ACL for Laravel 4. Based on and inspired by [lukaszb/django-guardian](https://github.com/lukaszb/django-guardian), an excellent Django library.

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

[](#installation)

Add the following line to the `require` section of `composer.json`:

```
{
    "require": {
        "georgebohnisch/redoubt-plus": "dev-master"
    }
}
```

Setup
-----

[](#setup)

1. Add `Georgebohnisch\Redoubt\RedoubtServiceProvider` to the service provider list in `app/config/app.php`.
2. Add `'Redoubt' => 'Georgebohnisch\Redoubt\Facades\Redoubt',` to the list of aliases in `app/config/app.php`.
3. If you're using Eloquent, run `php artisan migrate --package=georgebohnisch/redoubt-plus`.
4. OPTIONAL: If you plan to override any of the base classes (e.g. User), run `php artisan config:publish georgebohnisch/redoubt-plus`.

Usage
-----

[](#usage)

Redoubt offers two levels of permissions: users and groups. Users and groups can be given access to resources, and users can be associated to groups. Each resouce must have permission defined on it.

Redoubt uses Laravel's built-in polymorphic relations to handle its associations, so all you have to do is pass in the actual model.

### On resources

[](#on-resources)

Resources need to implement `Georgebohnisch\Redoubt\Permission\PermissibleInterface`, which defines one method, `getPermissions()`. The method needs to return an array where the key is the permission, and the value is the description:

```
class Article implements Georgebohnisch\Redoubt\Permission\PermissibleInterface
{
    public function getPermissions()
    {
        return array(
            'edit' => 'Edit an article',
            'view' => 'View an article',
        );
    }
}
```

This MUST be defined for each method; trying to associate a permission on a resource where the permission is not already defined will throw an error.

### To create a group:

[](#to-create-a-group)

```
$group = Redoubt::group()->create(array(
    'name' => 'My Group',
));
```

To create an admin group, add `'is_admin' => true,` into the `create()` statement.

### To associate a user to a resource:

[](#to-associate-a-user-to-a-resource)

```
$resource = Article::find(1);

Redoubt::allowUser('edit', $resource);
```

`allowUser()` has a third parameter for a user; if it's not defined, it will default to the current one used by Laravel's `Auth`.

### To deassociate a user to a resource:

[](#to-deassociate-a-user-to-a-resource)

```
Redoubt::disallowUser('edit', $resource);
```

### To associate a group to a resource:

[](#to-associate-a-group-to-a-resource)

```
$group = // your definition here...

Redoubt::allowGroup('edit', $resource, $group);
```

### To deassociate a group to a resource:

[](#to-deassociate-a-group-to-a-resource)

```
Redoubt::disallowGroup('edit', $resource, $group);
```

### To associate a user to a group:

[](#to-associate-a-user-to-a-group)

If you're using the default configuration, Users and Groups are Eloquent models, so you would do:

```
$user->groups()->attach($group);
```

### To check if a user has access:

[](#to-check-if-a-user-has-access)

```
Redoubt::userCan('edit', $resource); // returns a boolean
```

`Redoubt::userCan()` checks if the user has access or if they're in any groups that have that access. This function will return `true` for user who is in any admin groups.

### To get all permissions that a user has:

[](#to-get-all-permissions-that-a-user-has)

```
Redoubt::getPermissions();
```

`getPermissions()` can take three parameters: a user, an object, and a permission. All of these parameters are optional. If the first parameter is left as null, it will use the current user.

The following would get all the permissions the current user has for Articles.

```
$permissions = Redoubt::getPermissions(null, 'Article');
```

Similarly, this would get all the permissions the current user has for editing Articles.

```
$permissions = Redoubt::getPermissions(null, 'Article', 'edit');
```

You can pass in an Article object for the second parameter as well.

### To get users who have permissions to an object:

[](#to-get-users-who-have-permissions-to-an-object)

```
Redoubt::getUsers('edit', $resource);
```

Note that this will return UserObjectPermission models; you'll need to then call `->getUser()` to get the user.

### To get groups who have permissions to an object:

[](#to-get-groups-who-have-permissions-to-an-object)

```
Redoubt::getGroups('edit', $resource);
```

Note that this will return GroupObjectPermission models; you'll need to then call `->getGroup()` to get the group.

Other functions
---------------

[](#other-functions)

### To check if a user is in a group:

[](#to-check-if-a-user-is-in-a-group)

```
User::inGroup($groups);
```

`$groups` should be an array of `Group` objects.

### To get users in a group:

[](#to-get-users-in-a-group)

```
$group->getUsers()
```

This will return a collection of `User` objects.

Extension
---------

[](#extension)

Redoubt has a built-in User class, but if you want to extend it to use on your own, either extend `Georgebohnisch\Redoubt\User\EloquentUser` or implement the `Georgebohnisch\Redoubt\User\UserInterface` interface. You'll also need to publish the config for the package and change the user model listed there.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 60.7% 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 ~36 days

Total

6

Last Release

4436d ago

### Community

Maintainers

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

---

Top Contributors

[![greggilbert](https://avatars.githubusercontent.com/u/169482?v=4)](https://github.com/greggilbert "greggilbert (17 commits)")[![georgebohnisch](https://avatars.githubusercontent.com/u/494749?v=4)](https://github.com/georgebohnisch "georgebohnisch (8 commits)")[![wes-nz](https://avatars.githubusercontent.com/u/2945380?v=4)](https://github.com/wes-nz "wes-nz (3 commits)")

---

Tags

laravelaclresourcelaravel4

### Embed Badge

![Health badge](/badges/georgebohnisch-redoubt-plus/health.svg)

```
[![Health](https://phpackages.com/badges/georgebohnisch-redoubt-plus/health.svg)](https://phpackages.com/packages/georgebohnisch-redoubt-plus)
```

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[codegreencreative/laravel-samlidp

Make your PHP Laravel application an Identification Provider using SAML 2.0. This package allows you to implement your own Identification Provider (idP) using the SAML 2.0 standard to be used with supporting SAML 2.0 Service Providers (SP).

263763.5k1](/packages/codegreencreative-laravel-samlidp)[casbin/laravel-authz

An authorization library that supports access control models like ACL, RBAC, ABAC in Laravel.

324339.9k4](/packages/casbin-laravel-authz)[yajra/laravel-acl

Laravel ACL is a simple role, permission ACL for Laravel Framework.

112103.9k1](/packages/yajra-laravel-acl)[hasinhayder/tyro

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

6712.1k2](/packages/hasinhayder-tyro)[codebot/entrust

This package provides a flexible way to add Role-based Permissions to Laravel

1596.6k](/packages/codebot-entrust)

PHPackages © 2026

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