---
title: "Middleware — Auth for Laravel | Roundly"
description: "Six middleware aliases — bind a guard, require a verified or active account, demand a recent re-authentication and apply the locale."
url: https://roundly-consulting.com/open-source/docs/auth-for-laravel/middleware
language: en
---

[All packages](https://roundly-consulting.com/open-source.md)

[Auth for Laravel](https://roundly-consulting.com/open-source/docs/auth-for-laravel.md)

# Middleware

| Alias | Purpose |
| --- | --- |
| `authentication.guard:{guard}` | Binds a package route to its guard. |
| `authentication.verified[:guard]` | 403 email\_not\_verified for unverified accounts when verification is required. |
| `authentication.reauthenticated[:seconds[,guard]]` | 403 reauthentication\_required without a recent re-authentication (a second-factor one for accounts that have a second factor); 401 without an authenticated account. |
| `authentication.locale[:guard]` | Applies the account’s locale, else the negotiated one. |
| `authentication.active[:guard]` | 403 account\_disabled for disabled accounts. |
| `authentication.no-store` | Cache-Control: no-store, private + Pragma: no-cache. |

Without a guard parameter, a middleware uses the guard bound by authentication.guard, else authentication.default. Combine them on your own routes:

```php
Route::middleware(['auth:users', 'authentication.guard:users', 'authentication.active', 'authentication.verified'])
    ->group(fn () => Route::post('/orders', PlaceOrder::class));
```

```php
Route::delete('/account', DeleteAccount::class)
    ->middleware(['auth:users', 'authentication.guard:users', 'authentication.reauthenticated:300']);
```

## Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

[More ways to support, including crypto](https://roundly-consulting.com/support-us.md)

By donating, you agree to our [donation terms](https://roundly-consulting.com/donation-terms.md).

[Support our open source work (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Join us on Patreon (opens in a new tab)](https://www.patreon.com/cw/roundly)

## Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.

[Get a quote in 48 hours](https://roundly-consulting.com/contact.md) [Browse all packages](https://roundly-consulting.com/open-source/docs/auth-for-laravel.md)
