PHPackages                             gammamatrix/playground-auth - 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. gammamatrix/playground-auth

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

gammamatrix/playground-auth
===========================

The Playground authentication and authorization package for Laravel applications.

0569PHPCI passing

Since Sep 7Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/gammamatrix/playground-auth)[ Packagist](https://packagist.org/packages/gammamatrix/playground-auth)[ RSS](/packages/gammamatrix-playground-auth/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Playground Auth
===============

[](#playground-auth)

[![Playground CI Workflow](https://github.com/gammamatrix/playground-auth/actions/workflows/ci.yml/badge.svg?branch=develop)](https://raw.githubusercontent.com/gammamatrix/playground-auth/testing/develop/testdox.txt)[![Test Coverage](https://raw.githubusercontent.com/gammamatrix/playground-auth/testing/develop/coverage.svg)](tests)[![PHPStan Level 10 src and tests](https://camo.githubusercontent.com/022b70e6631d055205dfebf2aa7e53b3f63e7a3ea04a18e86429f279e29a29f1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c25323031302d627269676874677265656e)](.github/workflows/ci.yml#L128)

The Playground authentication and authorization package for [Laravel](https://laravel.com/docs/11.x) applications.

Read more on using Playground Auth [at the Read the Docs for Playground.](https://gammamatrix-playground.readthedocs.io/)

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

[](#installation)

You can install the package via composer:

```
composer require gammamatrix/playground-auth
```

**NOTE:** This package is required by [Playground: Login Blade](https://github.com/gammamatrix/playground-login-blade)

`artisan about`
---------------

[](#artisan-about)

Playground Auth provides information in the `artisan about` command.

[![screenshot of artisan about command with Playground Auth.](resources/docs/artisan-about-playground-auth.png)](resources/docs/artisan-about-playground-auth.png)

Configuration
-------------

[](#configuration)

You can publish the config file with:

```
php artisan vendor:publish --provider="Playground\Auth\ServiceProvider" --tag="playground-config"
```

See the contents of the published config file: [config/playground-auth.php](config/playground-auth.php)

The default configuration utitlizes:

- Sanctum
- Users may have additional abilities in the [`Playground\Models\User`](https://github.com/gammamatrix/playground/blob/develop/src/Models/User.php): `users.abilities`
- The Playground user model uses a UUID primary key along with additional fields. See the [migration for `Playground\Models\User`](https://github.com/gammamatrix/playground/blob/develop/database/migrations-playground/0001_01_01_000000_create_users_table.php)

Abilities, Privileges, Roles and Sanctum
----------------------------------------

[](#abilities-privileges-roles-and-sanctum)

Depending on your needs, there are multiple middleware, authentication and authorization options available.

Abilities may be used with wildcards at multiple levels. Optionally, these abilities may be used with [Sanctum](https://laravel.com/docs/11.x/sanctum) for API Tokens.

Here is an example of the configurable abilities:

```
    'abilities' => [
        'root' => [
            '*',
        ],
        'admin' => [
            'app:*',
            'playground:*',
            'playground-auth:*',
            'playground-cms:*',
            'playground-cms-resource:*',
            'playground-matrix:*',
            'playground-matrix-resource:*',
        ],
        'manager' => [
            'app:view',

            'playground:view',

            'playground-auth:logout',
            'playground-auth:reset-password',
// ...
        'user' => [
            'app:view',
// ...
        ],
        // No abilities for guests:
        'guest' => [
            'none',
        ],
        // Allow abilities for guests:
        'guest' => [
             'app:view',

             'playground:view',

             'playground-auth:logout',
             'playground-auth:reset-password',
// ...
```

- Packages may also be enabled to load privileges with the [PLAYGROUND\_AUTH\_PACKAGES environment variable.](https://github.com/gammamatrix/playground-auth/wiki/Environment-Variables)

### Environment Variables

[](#environment-variables)

Read more about [environment variables in the `config/playground-auth.php`](https://github.com/gammamatrix/playground-auth/blob/develop/config/playground-auth.php) on [Read the Docs: Playground](https://gammamatrix-playground.readthedocs.io/en/latest/playground/auth.html).

### User model types

[](#user-model-types)

Playground tests many different User model types to support any ecosystem.

Make sure your app is configured for the proper user model in the Laravel configuration:

```
    'providers' => [
        'users' => [
            'driver' => 'eloquent',
            'model' => env('AUTH__MODEL', App\Models\User::class),
        ],
```

During testing, Playground tests user various models.

```
config(['auth.providers.users.model' => 'Playground\\Models\\User'])
```

Commands
--------

[](#commands)

This package adds a command to hash a password from the command line:

```
artisan auth:hash-password 'some password'
```

```
artisan auth:hash-password 'some password' --json --pretty
```

```
{
    "hashed": "$2y$10$langzXKRw1GgO6VgF0IrSecqxi3gAsU5NgmmERT\/2pQXg06mSbEjS"
}
```

Cloc
----

[](#cloc)

```
composer cloc
```

```

```

PHPStan
-------

[](#phpstan)

Tests at level 9 on:

- `config/`
- `database/`
- `lang/`
- `resources/views/`
- `src/`
- `tests/Feature/`
- `tests/Unit/`

```
composer analyse
```

Coding Standards
----------------

[](#coding-standards)

```
composer format
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [Jeremy Postlethwaite](https://github.com/gammamatrix)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance43

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/a309c28cee3aff88250942e5bc4d01f2d5a53f8b52456f6352adc338dc9a121b?d=identicon)[gammamatrix](/maintainers/gammamatrix)

---

Top Contributors

[![gammamatrix](https://avatars.githubusercontent.com/u/524724?v=4)](https://github.com/gammamatrix "gammamatrix (30 commits)")

### Embed Badge

![Health badge](/badges/gammamatrix-playground-auth/health.svg)

```
[![Health](https://phpackages.com/badges/gammamatrix-playground-auth/health.svg)](https://phpackages.com/packages/gammamatrix-playground-auth)
```

###  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)
