{"id":44795519,"url":"https://github.com/josevte/laravel-developer-logins","last_synced_at":"2026-02-18T14:00:35.993Z","repository":{"id":338297752,"uuid":"1156340176","full_name":"JoseVte/laravel-developer-logins","owner":"JoseVte","description":"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.","archived":false,"fork":false,"pushed_at":"2026-02-12T16:03:16.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-16T19:33:32.218Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JoseVte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-12T14:40:04.000Z","updated_at":"2026-02-12T16:08:02.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/JoseVte/laravel-developer-logins","commit_stats":null,"previous_names":["josevte/laravel-developer-logins"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/JoseVte/laravel-developer-logins","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoseVte%2Flaravel-developer-logins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoseVte%2Flaravel-developer-logins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoseVte%2Flaravel-developer-logins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoseVte%2Flaravel-developer-logins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JoseVte","download_url":"https://codeload.github.com/JoseVte/laravel-developer-logins/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoseVte%2Flaravel-developer-logins/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29545294,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T13:00:00.370Z","status":"ssl_error","status_checked_at":"2026-02-17T12:57:14.072Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-16T12:42:47.326Z","updated_at":"2026-02-18T14:00:35.986Z","avatar_url":"https://github.com/JoseVte.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Developer Logins\n\n[![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)\n[![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)\n[![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)\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/josrom/laravel-developer-logins.svg?style=flat-square)](https://packagist.org/packages/josrom/laravel-developer-logins)\n[![Total Downloads](https://img.shields.io/packagist/dt/josrom/laravel-developer-logins.svg?style=flat-square)](https://packagist.org/packages/josrom/laravel-developer-logins)\n[![PHP Version](https://img.shields.io/packagist/php-v/josrom/laravel-developer-logins.svg?style=flat-square)](https://packagist.org/packages/josrom/laravel-developer-logins)\n[![License](https://img.shields.io/packagist/l/josrom/laravel-developer-logins.svg?style=flat-square)](https://packagist.org/packages/josrom/laravel-developer-logins)\n\nQuick 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.\n\n\u003e **⚠️ Security Warning**: This package is designed for development and staging environments only. Never enable it in production!\n\n## Features\n\n- 🚀 One-click authentication as any configured user\n- 🔒 Safe defaults (disabled in production by default)\n- 🎯 Works with Laravel Fortify + Inertia.js\n- 🔐 Optional 2FA bypass for developer logins\n- 🌐 Multiple authentication guard support\n- 🛡️ IP whitelist support (optional)\n- 📝 Activity logging for security auditing\n- ⚙️ Highly configurable via environment variables\n\n## Requirements\n\n- PHP 8.1+\n- Laravel 10.x, 11.x, 12.x, or 13.x\n- Laravel Fortify (for authentication)\n\n## Installation\n\n### 1. Install via Composer\n\n```bash\ncomposer require josrom/laravel-developer-logins --dev\n```\n\n### 2. Publish Configuration\n\n```bash\nphp artisan vendor:publish --tag=\"developer-logins-config\"\n```\n\n### 3. Configure Users\n\nBy default, the package fetches the first 10 users from your database automatically. You can customize this in `config/developer-logins.php`:\n\n**Option 1: Dynamic users from database (Recommended)**\n\n```php\n'users' =\u003e fn () =\u003e App\\Models\\User::limit(10)-\u003epluck('email', 'name')-\u003etoArray()\n```\n\n**Option 2: Static predefined users**\n\n```php\n'users' =\u003e [\n    'Admin' =\u003e 'admin@example.com',\n    'User' =\u003e 'user@example.com',\n]\n```\n\n### 4. Configure Environment Variables\n\nAdd to your `.env` file:\n\n```bash\n# Enable/disable developer logins\nDEVELOPER_LOGINS_ENABLED=true\n\n# Optional: Bypass 2FA for developer logins (default: false)\nDEVELOPER_LOGINS_BYPASS_2FA=false\n\n# Optional: IP whitelist (comma-separated)\nDEVELOPER_LOGINS_ALLOWED_IPS=127.0.0.1,::1\n```\n\n### 5. Integration\n\n#### For Blade Views\n\nAdd to your login view (e.g., `resources/views/auth/login.blade.php`):\n\n```blade\n@if(config('developer-logins.enabled'))\n    \u003cx-developer-logins::login-buttons /\u003e\n@endif\n```\n\n#### For Inertia.js + Vue\n\nThe package automatically shares developer logins data with Inertia. Add to your Login component:\n\n```vue\n\u003ctemplate\u003e\n    \u003cdiv v-if=\"$page.props.developerLogins\" class=\"mt-4 space-y-2\"\u003e\n        \u003cdiv class=\"text-sm text-amber-600 font-semibold\"\u003e\n            ⚠️ Developer Logins Enabled\n        \u003c/div\u003e\n\n        \u003cform\n            v-for=\"(credentials, label) in $page.props.developerLogins\"\n            :key=\"credentials\"\n            method=\"POST\"\n            :action=\"route('developer-logins.login-as')\"\n        \u003e\n            \u003cinput type=\"hidden\" name=\"_token\" :value=\"$page.props.csrf_token\"\u003e\n            \u003cinput type=\"hidden\" name=\"credentials\" :value=\"credentials\"\u003e\n            \u003cbutton\n                type=\"submit\"\n                class=\"w-full px-4 py-2 bg-amber-100 hover:bg-amber-200 rounded border border-amber-300\"\n            \u003e\n                Login as {{ label }} ({{ credentials }})\n            \u003c/button\u003e\n        \u003c/form\u003e\n    \u003c/div\u003e\n\u003c/template\u003e\n```\n\n## Configuration\n\nThe configuration file (`config/developer-logins.php`) provides extensive customization options:\n\n```php\nreturn [\n    // Enable/disable globally (default: only in local environment)\n    'enabled' =\u003e env('DEVELOPER_LOGINS_ENABLED', env('APP_ENV') === 'local'),\n\n    // User model class\n    'model' =\u003e App\\Models\\User::class,\n\n    // Column to match against (email, username, etc.)\n    'column' =\u003e 'email',\n\n    // Authentication guard (or null for default)\n    'guard' =\u003e null,\n\n    // Users for quick login (static array or closure)\n    // Option 1: Dynamic from database (Recommended)\n    'users' =\u003e fn () =\u003e App\\Models\\User::limit(10)-\u003epluck('email', 'name')-\u003etoArray(),\n\n    // Option 2: Static predefined users\n    // 'users' =\u003e [\n    //     'Admin' =\u003e 'admin@example.com',\n    //     'User' =\u003e 'user@example.com',\n    // ],\n\n    // Redirect after successful login\n    'redirect_to' =\u003e '/admin/dashboard',\n\n    // Bypass 2FA for developer logins (default: false)\n    'bypass_2fa' =\u003e env('DEVELOPER_LOGINS_BYPASS_2FA', false),\n\n    // IP whitelist (empty = allow all)\n    'allowed_ips' =\u003e array_filter(explode(',', env('DEVELOPER_LOGINS_ALLOWED_IPS', ''))),\n\n    // Log developer login attempts\n    'log_attempts' =\u003e env('DEVELOPER_LOGINS_LOG', true),\n\n    // Show warning message on login page\n    'show_warning' =\u003e true,\n\n    // Throw exception if enabled in production\n    'prevent_production' =\u003e true,\n];\n```\n\n## Usage\n\n### Basic Usage\n\nOnce configured, developer login buttons will appear on your login page. Click any button to authenticate as that user instantly.\n\n### Multiple Authentication Guards\n\nTo use a specific guard:\n\n```php\n// In config/developer-logins.php\n'guard' =\u003e 'admin',\n```\n\nOr specify per-user in a custom configuration.\n\n### IP Whitelist\n\nRestrict developer logins to specific IP addresses:\n\n```bash\n# .env\nDEVELOPER_LOGINS_ALLOWED_IPS=127.0.0.1,::1,192.168.1.100\n```\n\n### Logging\n\nAll developer login attempts are logged by default:\n\n```php\n// Log channel: 'stack' (default Laravel)\n// Log level: 'info'\n// Log format: \"Developer login attempt: {email} from IP: {ip}\"\n```\n\nDisable logging in `.env`:\n\n```bash\nDEVELOPER_LOGINS_LOG=false\n```\n\n### Two-Factor Authentication (2FA)\n\nBy default, developer logins still require 2FA if enabled on the user account. To bypass 2FA:\n\n```bash\n# .env\nDEVELOPER_LOGINS_BYPASS_2FA=true\n```\n\n⚠️ **Security Note**: Only enable 2FA bypass in trusted local environments.\n\n## Security\n\n### Built-in Safety Features\n\n✅ **Disabled by default in production** - Set `APP_ENV=production` and the package won't work\n✅ **Exception on production** - Throws `ConfigurationException` if enabled in production (configurable)\n✅ **IP whitelist support** - Restrict to specific IPs\n✅ **Activity logging** - All attempts logged for auditing\n✅ **CSRF protection** - Uses Laravel's CSRF tokens\n✅ **Warning messages** - Visual indicators on login page\n✅ **2FA respect** - Honors 2FA by default (bypass is opt-in)\n\n### Best Practices\n\n❌ **Never enable in production**\n✅ Use environment-specific `.env` files\n✅ Add to `.env.example` with safe defaults\n✅ Enable IP whitelist in shared staging environments\n✅ Keep logging enabled for security auditing\n✅ Only bypass 2FA in local environments\n\n## Troubleshooting\n\n### Buttons not appearing\n\n1. Check `APP_ENV` - Must be `local` or `staging` (or set `DEVELOPER_LOGINS_ENABLED=true`)\n2. Verify users exist in database with configured emails\n3. Clear config cache: `php artisan config:clear`\n4. Check logs: `storage/logs/laravel.log`\n\n### \"User not found\" error\n\nEnsure the configured email/username exists in your database:\n\n```bash\nphp artisan tinker\n\u003e\u003e\u003e User::where('email', 'admin@example.com')-\u003efirst();\n```\n\n### IP whitelist blocking access\n\nCheck your IP address:\n\n```bash\ncurl ifconfig.me\n```\n\nAdd it to `.env`:\n\n```bash\nDEVELOPER_LOGINS_ALLOWED_IPS=127.0.0.1,::1,YOUR_IP_HERE\n```\n\n### Production exception\n\nIf you see `ConfigurationException: Developer logins should not be enabled in production!`:\n\n1. Set `APP_ENV=production` in `.env`\n2. Or set `DEVELOPER_LOGINS_ENABLED=false`\n3. Or set `prevent_production =\u003e false` in config (not recommended)\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for recent changes.\n\n## Contributing\n\nContributions are welcome! Please see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nIf you discover a security vulnerability, please email security@example.com.\n\n## Credits\n\n- [Jose Vicente](https://github.com/JoseVte)\n- Inspired by [dutchcodingcompany/filament-developer-logins](https://github.com/dutchcodingcompany/filament-developer-logins)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosevte%2Flaravel-developer-logins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjosevte%2Flaravel-developer-logins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosevte%2Flaravel-developer-logins/lists"}