agile-creative-minds/laravel-dev-login-link
Composer 安装命令:
composer require agile-creative-minds/laravel-dev-login-link
包简介
Dev-only magic login link command for Laravel
README 文档
README
A dev-only Artisan command that generates one-time login links for Laravel.
Why this exists: During local development, you often need to quickly log in as different users without resetting passwords or navigating login forms. This package provides a single command to generate a secure, short-lived login link — saving time and reducing friction in your dev workflow.
Installation
composer require agile-creative-minds/laravel-dev-login-link --dev
The package auto-discovers, so no manual service provider registration is needed.
Usage
# Generate a login link for the first user # (if no users exist, a default admin user admin@example.com is created) php artisan dev:login-link # Generate a login link for a specific user php artisan dev:login-link 5
The generated URL is valid for 10 minutes.
Security
This package is designed for local development only:
- Routes are only registered when
APP_ENVislocal,development, ortesting - The command refuses to run in production environments
- URLs use Laravel's signed routes with short expiration times
- Requires shell/container access to generate links
Never enable this in production.
How It Works
- The command generates a temporary signed URL using
URL::temporarySignedRoute('dev.login', ...) - When visited, the
signedmiddleware verifies the URL hasn't been tampered with or expired - If valid, the user is logged in via
Auth::login()and redirected to/dashboard(or/if no dashboard route exists)
Troubleshooting
"I clicked the link but nothing seems different"
On a fresh Laravel install without an auth starter kit (Breeze, Jetstream, etc.), there's no /dashboard route or visible auth UI. The login is working, but you're redirected to / which doesn't show login status.
Solution: Install Laravel Breeze for a complete auth experience:
composer require laravel/breeze --dev php artisan breeze:install blade php artisan migrate
After this, the login link will redirect you to /dashboard where you'll see you're authenticated.
"I get redirected to the login page"
This usually means the session isn't persisting. Make sure your Laravel app has:
SESSION_DRIVERset in.env(e.g.,database,file,cookie)- The
sessionstable migrated if usingdatabasedriver - The
/dev-login/{user}route uses thewebmiddleware group (handled by the package by default)
"Route [dev.login] not defined"
The route only loads in local, development, or testing environments. Check your APP_ENV in .env:
APP_ENV=local
Requirements
- PHP 8.2+
- Laravel 11.x or 12.x (any app using the default
webguard andusersprovider) - For best experience: Laravel Breeze, Jetstream, or custom auth scaffolding
License
MIT
agile-creative-minds/laravel-dev-login-link 适用场景与选型建议
agile-creative-minds/laravel-dev-login-link 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 02 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 agile-creative-minds/laravel-dev-login-link 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 agile-creative-minds/laravel-dev-login-link 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 24
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-05