PHPackages                             advanced-store/access-filter - 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. advanced-store/access-filter

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

advanced-store/access-filter
============================

Creates simple access filter functionality.

060PHP

Since Oct 28Pushed 10y ago7 watchersCompare

[ Source](https://github.com/advancedSTORE/access-filter)[ Packagist](https://packagist.org/packages/advanced-store/access-filter)[ RSS](/packages/advanced-store-access-filter/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (2)Used By (0)

[![Creative Commons License](https://camo.githubusercontent.com/627f8381f39aaac7fd5516a4eb37d169132626708878080d77999e11b1321eea/687474703a2f2f692e6372656174697665636f6d6d6f6e732e6f72672f6c2f62792d6e632d6e642f342e302f38307831352e706e67)](http://creativecommons.org/licenses/by-nc-nd/4.0/)
This work is licensed under a [Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License](http://creativecommons.org/licenses/by-nc-nd/4.0/).

Access Filter
=============

[](#access-filter)

This package adds functionality to laravel which allows you to create and use a simple permission filter for routes.

1. Installation
---------------

[](#1-installation)

#### via Composer

[](#via-composer)

First add the following line to your **composer.json** .

`"advanced-store/access-filter": "dev-master"`Run this command in you CLI.

`composer update`2. Configuration
----------------

[](#2-configuration)

#### Publish package config

[](#publish-package-config)

Run the following command if you are installing for the first time.

```

    php artisan config:publish advanced-store/access-filter

```

 Edit the configuration file accessFilterConfig and add the userPermissions. These should come either from your Sentry/User models or be hardcoded for testing purpose. In future these will be extractable through the ad4mat API client.

Add following lines to your app.php.

#### Provider

[](#provider)

```

    'AdvancedStore\AccessFilter\AccessFilterServiceProvider',

```

#### Aliases

[](#aliases)

```

    'YourAlias' => 'AdvancedStore\AccessFilter\Facades\AccessFilterFacade',

```

 Edit the configuration file permissionList.php and insert your route-names and the most nested minimum required permission the user must have to access this route.

 My convention for permission naming is :

```

        [{SystemName}].{ApplicationName}.{Root}.{SubScope}.[0..* {SubScope}]

```

 Example :

 Route-name is "admin/users" Required permission could be "myApplicationName.admin.users.listAll" The configuration array would look like this.

    ```

        return [
            "admin/users"   =>  [
                "myApplicationName.admin.users.listAll",
            ],
        ]

```

 It is also possible to set multiple sub-permissions which are equally leveled. The user is required to have only one of there. Notice that I prefer to use also dotted naming for my route-names.

```

    return [
        "admin.users.index" =>  [
            "ad4mat.admin.users.read",
            "ad4mat.admin.users.self",
        ],
    ]

```

 This can come in handy if the user should have the possibility to get access to the users.index route but he should only see his own profile or all , you can decide that inside of your controller.

3. Usage
--------

[](#3-usage)

 To check for a certain permission for example if you want to use it in a sidebar menu to display only certain elements.

### Structure

[](#structure)

```

    YourAlias::hasPermission( permissionString )

```

Example from my code

`    @if( AccessFilter::hasPermission('ad4mat.admin.roles.read') )` If you want to use it to protect resources/routes than you create filter which calls the filter method and add it to which ever resource/route you like.

Create Filter

 O2Client is my alias for the oauth2-client package which checks for a existence of a valid token before the actual filter check is applied.

```

    Route::filter('accessFilter', function(){
    if( O2Client::hasValidAccessToken() == false )
        return Redirect::guest('logout');

    return AccessFilter::filter();
});

```

`    Notice Laravel only creates route-names for resources if you use single routes    you have to add them yourself. These are the ones matches against the configuration array.`

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/328df272c4415d3da2c2a514322c5f21ba291df49506f1fe10549c7dd407a715?d=identicon)[dazero0](/maintainers/dazero0)

### Embed Badge

![Health badge](/badges/advanced-store-access-filter/health.svg)

```
[![Health](https://phpackages.com/badges/advanced-store-access-filter/health.svg)](https://phpackages.com/packages/advanced-store-access-filter)
```

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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