PHPackages                             thomas-miceli/voters - 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. [Security](/categories/security)
4. /
5. thomas-miceli/voters

ActiveLibrary[Security](/categories/security)

thomas-miceli/voters
====================

Check and validate complex specific user permissions.

1.0(5y ago)112[1 PRs](https://github.com/thomiceli/voters/pulls)GPL-3.0-onlyPHPPHP &gt;=7.4CI passing

Since Apr 28Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/thomiceli/voters)[ Packagist](https://packagist.org/packages/thomas-miceli/voters)[ Docs](https://github.com/thomas-miceli/voters)[ RSS](/packages/thomas-miceli-voters/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

Voters
======

[](#voters)

Useful to check complex user permissions.

###### Inspired from [Symfony voter system](https://symfony.com/doc/current/security/voters.html).

[](#inspired-from-symfony-voter-system)

### Installation

[](#installation)

```
$ composer require thomas-miceli/voters
```

### Usage

[](#usage)

To check a specific permission of an user action `$attribute` (e.g. view or edit) with or without a `$subject` (e.g. an article), every registered voters will be called and will be checked to see if they can vote for the permission. Every eligible voters will vote whether the user can have the permission or not.

Let's setup permissions for our blog.

#### Create the Permission object

[](#create-the-permission-object)

```
