folivaresrios/overseer

Laravel package designed to manage profiles and permissions based on Routing Laravel Features

1.2 2018-02-19 04:00 UTC

This package is not auto-updated.

Last update: 2024-12-21 21:31:20 UTC


README

Laravel 5.3 License

Structure Based: caffeinated/shinobi

Overseer provides a simple profile-based permissions system to Laravel's built in Auth system. Overseer provides support for the following ACL structure:

  • Every user can have zero or more profiles.
  • Every profile can have zero or more permissions.

Permissions are then inherited to the user through the user's assigned profiles.

The package follows the FIG standards PSR-1, PSR-2, and PSR-4. This package is not unit tested, but is planned to be covered.

Documentation

Wiki: KissDev Overseer Wiki

Requirements

The master branch has the following requirements:

  • Laravel 5.* or greater.
  • PHP 5.6.4 or greater.

How to Install?

[Using Composer]

Add the plugin to your project's composer.json - something like this:

{
  "require": {
    "folivaresrios/overseer": "^1.0"
  }
}

or through command line

composer require folivaresrios/overseer

Service Provider and Facade

Once this operation is complete, simply add the service provider and alias to your project's config/app.php file and run the provided migrations against your database.

'providers' => [
    //...
    KissDev\Overseer\OverseerServiceProvider::class,
    //...
];
'aliases' => [
    // ...
    'Overseer' => KissDev\Overseer\Facades\Overseer::class,
    // ...
],

Migrations

You'll need to run the provided migrations against your database. Publish the migration files using the vendor:publish Artisan command and run migrate:

php artisan vendor:publish
php artisan migrate

Route Middleware

Add the following middleware to the $routeMiddleware array in app/Http/Kernel.php BEFORE the EncryptCookies middleware:

protected $routeMiddleware = [
    //...
    'profile.overseer' => \KissDev\Overseer\Middleware\UserHasProfile::class,
    'permissions.overseer' => \KissDev\Overseer\Middleware\UserHasPermission::class,
    //...
];

Reporting Issues

If you have a problem with Overseer please open an issue on GitHub.

Contributing

If you'd like to contribute to Overseer creating something you'd like added, send a pull requests or open issues.