PHPackages                             nikfedorov/auto-login - 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. nikfedorov/auto-login

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

nikfedorov/auto-login
=====================

Auto-login middleware for Laravel — logs in the first database user in allowed environments during development.

v1.0.0(1mo ago)03↓50%MITPHPPHP ^8.2

Since Jun 11Pushed 1mo agoCompare

[ Source](https://github.com/nikfedorov/auto-login)[ Packagist](https://packagist.org/packages/nikfedorov/auto-login)[ RSS](/packages/nikfedorov-auto-login/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (14)Versions (3)Used By (0)

Auto Login
==========

[](#auto-login)

Middleware that automatically logs in the first database user in allowed environments — skip the login screen during development.

If no user exists yet, the request passes through unauthenticated. Run your seeders first.

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 11 / 12 / 13

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

[](#installation)

```
composer require nikfedorov/auto-login
```

Then register the middleware:

```
php artisan auto-login:install
```

This adds the middleware to `bootstrap/app.php`:

```
->withMiddleware(function (Middleware $middleware): void {
    $middleware->append(AutoLoginLocal::class);
})
```

You can also register it manually instead of running the command.

Optionally publish the config:

```
php artisan vendor:publish --tag=auto-login-config
```

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

[](#configuration)

Env variableDefaultDescription`AUTOLOGIN_ENABLED``true`Enable or disable auto-login globally`AUTOLOGIN_ENVIRONMENTS``local`Comma-separated list of allowed environmentsHow it works
------------

[](#how-it-works)

On each request:

1. Skips if the user is already authenticated.
2. Skips if `auto-login.enabled` is `false`.
3. Skips if the current `APP_ENV` is not in `auto-login.environments`.
4. Resolves the user model from `auth.providers.users.model`, grabs the first record, and logs them in.

In any environment not listed in `AUTOLOGIN_ENVIRONMENTS` (e.g. `production`, `staging`) the middleware is a no-op.

Testing
-------

[](#testing)

```
composer test
```

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance91

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

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 ~0 days

Total

2

Last Release

45d ago

Major Versions

0.0.1 → v1.0.02026-06-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/6edb2363f514bee1012fde03044b21e45b0425bea50f39074eae016d252c73ba?d=identicon)[n1kfedorov](/maintainers/n1kfedorov)

---

Top Contributors

[![nikfedorov](https://avatars.githubusercontent.com/u/42058?v=4)](https://github.com/nikfedorov "nikfedorov (1 commits)")

---

Tags

middlewarelaraveldevelopmentauto-login

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/nikfedorov-auto-login/health.svg)

```
[![Health](https://phpackages.com/badges/nikfedorov-auto-login/health.svg)](https://phpackages.com/packages/nikfedorov-auto-login)
```

###  Alternatives

[jeremy379/laravel-openid-connect

OpenID Connect support to the PHP League's OAuth2 Server. Compatible with Laravel Passport.

61437.0k9](/packages/jeremy379-laravel-openid-connect)[spatie/laravel-authorize

A middleware to check authorization

20726.4k1](/packages/spatie-laravel-authorize)[api-platform/laravel

API Platform support for Laravel

58174.6k17](/packages/api-platform-laravel)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21318.6k3](/packages/ecotone-laravel)

PHPackages © 2026

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