PHPackages                             josrom/laravel-developer-logins - 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. josrom/laravel-developer-logins

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

josrom/laravel-developer-logins
===============================

Quick developer authentication for Laravel applications in local/staging environments

1.0.0(3mo ago)06MITPHPPHP ^8.1CI passing

Since Feb 12Pushed 3mo agoCompare

[ Source](https://github.com/JoseVte/laravel-developer-logins)[ Packagist](https://packagist.org/packages/josrom/laravel-developer-logins)[ Docs](https://github.com/JoseVte/laravel-developer-logins)[ RSS](/packages/josrom-laravel-developer-logins/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (9)Versions (2)Used By (0)

Laravel Developer Logins
========================

[](#laravel-developer-logins)

[![Tests](https://github.com/JoseVte/laravel-developer-logins/actions/workflows/tests.yml/badge.svg)](https://github.com/JoseVte/laravel-developer-logins/actions/workflows/tests.yml)[![PHPStan](https://github.com/JoseVte/laravel-developer-logins/actions/workflows/phpstan.yml/badge.svg)](https://github.com/JoseVte/laravel-developer-logins/actions/workflows/phpstan.yml)[![Code Style](https://github.com/JoseVte/laravel-developer-logins/actions/workflows/code-style.yml/badge.svg)](https://github.com/JoseVte/laravel-developer-logins/actions/workflows/code-style.yml)[![Latest Version on Packagist](https://camo.githubusercontent.com/eb1fd5a780f32f98c72af98cbff86299fd4ff2aef2f74eaab167bde0f4cdb10c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6f73726f6d2f6c61726176656c2d646576656c6f7065722d6c6f67696e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/josrom/laravel-developer-logins)[![Total Downloads](https://camo.githubusercontent.com/9ec39817b3fb792faf846a94d65784b61ffc8c7592d1902044f0aed4d2f41977/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6f73726f6d2f6c61726176656c2d646576656c6f7065722d6c6f67696e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/josrom/laravel-developer-logins)[![PHP Version](https://camo.githubusercontent.com/dd47f809c2df329868ba88d96d8f3439120afd0edec1dcbe0e1a9c3408852ced/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6a6f73726f6d2f6c61726176656c2d646576656c6f7065722d6c6f67696e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/josrom/laravel-developer-logins)[![License](https://camo.githubusercontent.com/e9abf50e8289cc75a4fe735badd6060cb484d9f9b42036795dc13bb9914f4f8d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6a6f73726f6d2f6c61726176656c2d646576656c6f7065722d6c6f67696e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/josrom/laravel-developer-logins)

Quick developer authentication for Laravel applications in local/staging environments. Skip the login form during development by clicking a button to authenticate as any predefined user.

> **⚠️ Security Warning**: This package is designed for development and staging environments only. Never enable it in production!

Features
--------

[](#features)

- 🚀 One-click authentication as any configured user
- 🔒 Safe defaults (disabled in production by default)
- 🎯 Works with Laravel Fortify + Inertia.js
- 🔐 Optional 2FA bypass for developer logins
- 🌐 Multiple authentication guard support
- 🛡️ IP whitelist support (optional)
- 📝 Activity logging for security auditing
- ⚙️ Highly configurable via environment variables

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

[](#requirements)

- PHP 8.1+
- Laravel 10.x, 11.x, 12.x, or 13.x
- Laravel Fortify (for authentication)

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

[](#installation)

### 1. Install via Composer

[](#1-install-via-composer)

```
composer require josrom/laravel-developer-logins --dev
```

### 2. Publish Configuration

[](#2-publish-configuration)

```
php artisan vendor:publish --tag="developer-logins-config"
```

### 3. Configure Users

[](#3-configure-users)

By default, the package fetches the first 10 users from your database automatically. You can customize this in `config/developer-logins.php`:

**Option 1: Dynamic users from database (Recommended)**

```
'users' => fn () => App\Models\User::limit(10)->pluck('email', 'name')->toArray()
```

**Option 2: Static predefined users**

```
'users' => [
    'Admin' => 'admin@example.com',
    'User' => 'user@example.com',
]
```

### 4. Configure Environment Variables

[](#4-configure-environment-variables)

Add to your `.env` file:

```
# Enable/disable developer logins
DEVELOPER_LOGINS_ENABLED=true

# Optional: Bypass 2FA for developer logins (default: false)
DEVELOPER_LOGINS_BYPASS_2FA=false

# Optional: IP whitelist (comma-separated)
DEVELOPER_LOGINS_ALLOWED_IPS=127.0.0.1,::1
```

### 5. Integration

[](#5-integration)

#### For Blade Views

[](#for-blade-views)

Add to your login view (e.g., `resources/views/auth/login.blade.php`):

```
@if(config('developer-logins.enabled'))

@endif
```

#### For Inertia.js + Vue

[](#for-inertiajs--vue)

The package automatically shares developer logins data with Inertia. Add to your Login component:

```

            ⚠️ Developer Logins Enabled

                Login as {{ label }} ({{ credentials }})

```

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

[](#configuration)

The configuration file (`config/developer-logins.php`) provides extensive customization options:

```
return [
    // Enable/disable globally (default: only in local environment)
    'enabled' => env('DEVELOPER_LOGINS_ENABLED', env('APP_ENV') === 'local'),

    // User model class
    'model' => App\Models\User::class,

    // Column to match against (email, username, etc.)
    'column' => 'email',

    // Authentication guard (or null for default)
    'guard' => null,

    // Users for quick login (static array or closure)
    // Option 1: Dynamic from database (Recommended)
    'users' => fn () => App\Models\User::limit(10)->pluck('email', 'name')->toArray(),

    // Option 2: Static predefined users
    // 'users' => [
    //     'Admin' => 'admin@example.com',
    //     'User' => 'user@example.com',
    // ],

    // Redirect after successful login
    'redirect_to' => '/admin/dashboard',

    // Bypass 2FA for developer logins (default: false)
    'bypass_2fa' => env('DEVELOPER_LOGINS_BYPASS_2FA', false),

    // IP whitelist (empty = allow all)
    'allowed_ips' => array_filter(explode(',', env('DEVELOPER_LOGINS_ALLOWED_IPS', ''))),

    // Log developer login attempts
    'log_attempts' => env('DEVELOPER_LOGINS_LOG', true),

    // Show warning message on login page
    'show_warning' => true,

    // Throw exception if enabled in production
    'prevent_production' => true,
];
```

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

Once configured, developer login buttons will appear on your login page. Click any button to authenticate as that user instantly.

### Multiple Authentication Guards

[](#multiple-authentication-guards)

To use a specific guard:

```
// In config/developer-logins.php
'guard' => 'admin',
```

Or specify per-user in a custom configuration.

### IP Whitelist

[](#ip-whitelist)

Restrict developer logins to specific IP addresses:

```
# .env
DEVELOPER_LOGINS_ALLOWED_IPS=127.0.0.1,::1,192.168.1.100
```

### Logging

[](#logging)

All developer login attempts are logged by default:

```
// Log channel: 'stack' (default Laravel)
// Log level: 'info'
// Log format: "Developer login attempt: {email} from IP: {ip}"
```

Disable logging in `.env`:

```
DEVELOPER_LOGINS_LOG=false
```

### Two-Factor Authentication (2FA)

[](#two-factor-authentication-2fa)

By default, developer logins still require 2FA if enabled on the user account. To bypass 2FA:

```
# .env
DEVELOPER_LOGINS_BYPASS_2FA=true
```

⚠️ **Security Note**: Only enable 2FA bypass in trusted local environments.

Security
--------

[](#security)

### Built-in Safety Features

[](#built-in-safety-features)

✅ **Disabled by default in production** - Set `APP_ENV=production` and the package won't work ✅ **Exception on production** - Throws `ConfigurationException` if enabled in production (configurable) ✅ **IP whitelist support** - Restrict to specific IPs ✅ **Activity logging** - All attempts logged for auditing ✅ **CSRF protection** - Uses Laravel's CSRF tokens ✅ **Warning messages** - Visual indicators on login page ✅ **2FA respect** - Honors 2FA by default (bypass is opt-in)

### Best Practices

[](#best-practices)

❌ **Never enable in production**✅ Use environment-specific `.env` files ✅ Add to `.env.example` with safe defaults ✅ Enable IP whitelist in shared staging environments ✅ Keep logging enabled for security auditing ✅ Only bypass 2FA in local environments

Troubleshooting
---------------

[](#troubleshooting)

### Buttons not appearing

[](#buttons-not-appearing)

1. Check `APP_ENV` - Must be `local` or `staging` (or set `DEVELOPER_LOGINS_ENABLED=true`)
2. Verify users exist in database with configured emails
3. Clear config cache: `php artisan config:clear`
4. Check logs: `storage/logs/laravel.log`

### "User not found" error

[](#user-not-found-error)

Ensure the configured email/username exists in your database:

```
php artisan tinker
>>> User::where('email', 'admin@example.com')->first();
```

### IP whitelist blocking access

[](#ip-whitelist-blocking-access)

Check your IP address:

```
curl ifconfig.me
```

Add it to `.env`:

```
DEVELOPER_LOGINS_ALLOWED_IPS=127.0.0.1,::1,YOUR_IP_HERE
```

### Production exception

[](#production-exception)

If you see `ConfigurationException: Developer logins should not be enabled in production!`:

1. Set `APP_ENV=production` in `.env`
2. Or set `DEVELOPER_LOGINS_ENABLED=false`
3. Or set `prevent_production => false` in config (not recommended)

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for recent changes.

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

[](#contributing)

Contributions are welcome! Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

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

[](#security-vulnerabilities)

If you discover a security vulnerability, please email .

Credits
-------

[](#credits)

- [Jose Vicente](https://github.com/JoseVte)
- Inspired by [dutchcodingcompany/filament-developer-logins](https://github.com/dutchcodingcompany/filament-developer-logins)

License
-------

[](#license)

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

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance82

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

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

Unknown

Total

1

Last Release

95d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2277596?v=4)[Jose Romero](/maintainers/Josrom)[@josrom](https://github.com/josrom)

---

Top Contributors

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

---

Tags

laravelAuthenticationdevelopmentlogindeveloper

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/josrom-laravel-developer-logins/health.svg)

```
[![Health](https://phpackages.com/badges/josrom-laravel-developer-logins/health.svg)](https://phpackages.com/packages/josrom-laravel-developer-logins)
```

###  Alternatives

[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.5k49.1M350](/packages/tymon-jwt-auth)[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

8359.8M53](/packages/php-open-source-saver-jwt-auth)[laragear/two-factor

On-premises 2FA Authentication for out-of-the-box.

339785.3k8](/packages/laragear-two-factor)[auth0/login

Auth0 Laravel SDK. Straight-forward and tested methods for implementing authentication, and accessing Auth0's Management API endpoints.

2745.0M3](/packages/auth0-login)[alajusticia/laravel-logins

Session management in Laravel apps, user notifications on new access, support for multiple separate remember tokens, IP geolocation, User-Agent parser

2011.0k](/packages/alajusticia-laravel-logins)[maize-tech/laravel-magic-login

Laravel Magic Login

1808.1k](/packages/maize-tech-laravel-magic-login)

PHPackages © 2026

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