PHPackages                             berthott/laravel-scopeable - 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. berthott/laravel-scopeable

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

berthott/laravel-scopeable
==========================

Laravel helper for permission scopes

3.0.0(3y ago)09032MITPHP

Since Sep 9Pushed 1y ago2 watchersCompare

[ Source](https://github.com/berthott/laravel-scopeable)[ Packagist](https://packagist.org/packages/berthott/laravel-scopeable)[ RSS](/packages/berthott-laravel-scopeable/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (4)Versions (3)Used By (2)

[![test workflow](https://github.com/berthott/laravel-scopeable/actions/workflows/test.yml/badge.svg)](https://github.com/berthott/laravel-scopeable/actions/workflows/test.yml/badge.svg)

Laravel-Scopeable - A helper for permission scopes in Laravel
=============================================================

[](#laravel-scopeable---a-helper-for-permission-scopes-in-laravel)

This is a helper to add permission scopes to your model by adding a trait. It's used by [laravel-crudable](https://github.com/berthott/laravel-crudable) and [laravel-sheetable](https://github.com/syspons-dev/laravel-sheetable).

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

[](#installation)

```
$ composer require berthott/laravel-scopeable

```

Usage
-----

[](#usage)

- Create your table and corresponding model, eg. with `php artisan make:model YourModel -m`
- Add the `Scopeable` Trait to your newly generated model.
- Relate your scopeable model to your User class.
- Now you can use Scopeable::checkScopes() to check whether the currently logged in user has the same scope as the requested resource or Scopeable::filterScopes() to filter a collection for models matching the currently logged in users scopes.

Options
-------

[](#options)

To change the default options use

```
$ php artisan vendor:publish --provider="berthott\Scopeable\ScopeableServiceProvider" --tag="config"

```

- `namespace`: string or array with one ore multiple namespaces that should be monitored for the Scopeable-Trait. Defaults to `App\Models`.
- `namespace_mode`: Defines the search mode for the namespaces. `ClassFinder::STANDARD_MODE` will only find the exact matching namespace, `ClassFinder::RECURSIVE_MODE` will find all subnamespaces. Defaults to `ClassFinder::STANDARD_MODE`.

Compatibility
-------------

[](#compatibility)

Tested with Laravel 10.x.

License
-------

[](#license)

See [License File](license.md). Copyright © 2023 Jan Bladt.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~159 days

Total

2

Last Release

1224d ago

Major Versions

2.0.0 → 3.0.02023-02-16

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3034025?v=4)[Jan Bladt](/maintainers/berthott)[@berthott](https://github.com/berthott)

---

Top Contributors

[![berthott](https://avatars.githubusercontent.com/u/3034025?v=4)](https://github.com/berthott "berthott (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/berthott-laravel-scopeable/health.svg)

```
[![Health](https://phpackages.com/badges/berthott-laravel-scopeable/health.svg)](https://phpackages.com/packages/berthott-laravel-scopeable)
```

###  Alternatives

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.2M17](/packages/kartik-v-yii2-password)[yorcreative/laravel-scrubber

A laravel package that scrubs sensitive information for you.

15776.6k2](/packages/yorcreative-laravel-scrubber)[dlnsk/h-rbac

Based on native Laravel's gates and policies. Hierarchical RBAC with callbacks.

378.5k](/packages/dlnsk-h-rbac)[yakovenko/laravel-lighthouse-graphql-multi-schema

A Laravel package that provides multi-schema support for Lighthouse GraphQL.

17112.5k](/packages/yakovenko-laravel-lighthouse-graphql-multi-schema)[better-futures-studio/filament-local-logins

This is my package filament-local-logins

1334.6k](/packages/better-futures-studio-filament-local-logins)

PHPackages © 2026

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