LaravelPackages.net
Acme Inc.
Toggle sidebar
rdx/laravel-authgate-policies

Takes abilities from a list of policy classes.

8.283
0
1.0
About rdx/laravel-authgate-policies

rdx/laravel-authgate-policies is a Laravel package for takes abilities from a list of policy classes.. It currently has 0 GitHub stars and 8.283 downloads on Packagist (latest version 1.0). Install it with composer require rdx/laravel-authgate-policies. Discover more Laravel packages by rdx or browse all Laravel packages to compare alternatives.

Last updated

Setup

  1. Install with composer.
  2. Define which policies to load in your AuthServiceProvider (see below).

Abilities' names will follow method names:

  • function manageAllUsers() becomes ability manage-all-users
  • function see360DegreeFeedback() becomes ability see360-degrees-feedback
  • function see_360DegreeFeedback() becomes ability see-360-degrees-feedback

Replace your AuthServiceProvider with this:

use App\Policies;
use rdx\authgate\PoliciesServiceProvider;

class AuthServiceProvider extends PoliciesServiceProvider {

	protected $policies = [
		Policies\UserPolicy::class,
		Policies\FilePolicy::class,
		// All your policy classes
	];

}

If you want to add more register() or boot() code, be sure to call parent::register() or parent::boot()!

See PoliciesServiceProvider for more options.

Star History Chart