PHPackages                             creode/laravel-account-approval - 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. creode/laravel-account-approval

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

creode/laravel-account-approval
===============================

A Laravel package which provides basic functionality for users to require account approval after registration.

1.2.0(1y ago)038[1 PRs](https://github.com/creode-modules/laravel-account-approval/pulls)1MITPHPPHP ^8.1

Since Jan 12Pushed 1y ago1 watchersCompare

[ Source](https://github.com/creode-modules/laravel-account-approval)[ Packagist](https://packagist.org/packages/creode/laravel-account-approval)[ Docs](https://github.com/creode-modules/laravel-account-approval)[ GitHub Sponsors](https://github.com/Creode)[ RSS](/packages/creode-laravel-account-approval/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (3)Dependencies (12)Versions (5)Used By (1)

Laravel Account Approval
========================

[](#laravel-account-approval)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d7cdfcabc1262ed8d8cbe0c38dce30130c4bbdf452911ab9b190444e89590250/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6372656f64652f6c61726176656c2d6163636f756e742d617070726f76616c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/creode/laravel-account-approval)[![GitHub Tests Action Status](https://camo.githubusercontent.com/9b6fc7512a11765ba86c09522131fdc8f859104f40531b7bb63957ae526104c4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6372656f64652d6d6f64756c65732f6c61726176656c2d6163636f756e742d617070726f76616c2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/creode-modules/laravel-account-approval/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/76c699ea5a79e7e83332bdefc504311854d732f6a9b08fd7061ac00b7adcca9d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6372656f64652d6d6f64756c65732f6c61726176656c2d6163636f756e742d617070726f76616c2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/creode-modules/laravel-account-approval/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/1a37fc2fc4202aedbf7cb7bd5f979de4d138aa1f850e52de70a7d97e27fe6d9d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6372656f64652f6c61726176656c2d6163636f756e742d617070726f76616c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/creode/laravel-account-approval)

A Laravel package which provides basic functionality for users to require account approval after registration.

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

[](#installation)

You can install the package via composer:

```
composer require creode/laravel-account-approval
```

Migrations
----------

[](#migrations)

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="account-approval-migrations"
php artisan migrate
```

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

[](#configuration)

You can publish the config file with:

```
php artisan vendor:publish --tag="account-approval-config"
```

Thie following options are available in the config file:

- `users_table` - The name of the users table in the database. Defaults to `users`.
- `account_not_verified_message` - The message shown flashed to session when an account is not verified. Defaults to `Your account has not been verified. Please check your email for a verification link.`.

Middleware
----------

[](#middleware)

In order to prevent users from accessing the site until they have been approved, the `AccountActivated` middleware should be added to the `web` middleware group in `app/Http/Kernel.php`:

```
protected $middlewareGroups = [
    'web' => [
        // ...
        \Creode\LaravelAccountApproval\Http\Middleware\AccountActivated::class,
    ],
    // ...
];
```

This middleware will run on every request, detect if the user is logged in and if they are not approved, redirect them to the `login` route. This route can be configured in the `config/account-approval.php` file.

Extending Middleware
--------------------

[](#extending-middleware)

If you need to execute some custom functionality for the current website you can extend the `AccountActivated` middleware and override the `accountNotActivated` method. This will allow you to execute your custom functionality. The `unverifiedAccountRedirect` function can also be overridden to allow you to redirect to a custom route and set your own messaging/functionality.

```
namespace App\Http\Middleware;

use Closure;
use Creode\LaravelAccountApproval\Http\Middleware\AccountActivated as BaseAccountActivated;

class AccountActivated extends BaseAccountActivated
{
    /**
     * Handle a failed activation.
     *
     * @param \Illuminate\Http\Request  $request
     * @param \Closure  $next
     *
     * @return mixed
     */
    protected function accountNotActivated(Request $request, Closure $next)
    {
        // Your custom functionality here
    }

    /**
     * Redirect which will happen if the user is not activated.
     *
     * Return null to continue with the request.
     *
     * @param Request $request
     * @param Closure $next
     *
     * @return Response|null
     */
    protected function unverifiedAccountRedirect(Request $request, Closure $next): ?Response
    {
        // Your custom functionality here
    }
}
```

Usage
-----

[](#usage)

Following package installation, running the migrations command will add an `activated` column to the users table. This defaults to `false` for all users. It is assumed this is the best configuration to get a site up and running quickly.

Alternatively, running the seeder provided in this module will set all existing users to be approved. This can be run with the following command:

```
php artisan db:seed --class="Creode\LaravelAccountApproval\Database\Seeders\AccountApprovalSeeder"
```

This will resolve the default authentication model and set the activated flag to `true` for all users.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Creode](https://github.com/creode-dev)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.9% 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 ~95 days

Total

4

Last Release

571d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8133041?v=4)[Creode](/maintainers/creode)[@creode](https://github.com/creode)

---

Top Contributors

[![jaymeh](https://avatars.githubusercontent.com/u/18261676?v=4)](https://github.com/jaymeh "jaymeh (16 commits)")[![liam-spedding](https://avatars.githubusercontent.com/u/111750536?v=4)](https://github.com/liam-spedding "liam-spedding (2 commits)")

---

Tags

laravelcreodelaravel-account-approval

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/creode-laravel-account-approval/health.svg)

```
[![Health](https://phpackages.com/badges/creode-laravel-account-approval/health.svg)](https://phpackages.com/packages/creode-laravel-account-approval)
```

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k89.8M1.0k](/packages/spatie-laravel-permission)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[jeffgreco13/filament-breezy

A custom package for Filament with login flow, profile and teams support.

1.0k1.7M41](/packages/jeffgreco13-filament-breezy)[spatie/laravel-login-link

Quickly login to your local environment

4381.2M1](/packages/spatie-laravel-login-link)[ryangjchandler/laravel-cloudflare-turnstile

A simple package to help integrate Cloudflare Turnstile.

438896.6k2](/packages/ryangjchandler-laravel-cloudflare-turnstile)[spatie/laravel-passkeys

Use passkeys in your Laravel app

444494.4k16](/packages/spatie-laravel-passkeys)

PHPackages © 2026

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