agile-creative-minds/laravel-dev-login-link 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

Latest Version Packagist Downloads CI License

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_ENV is local, development, or testing
  • 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

  1. The command generates a temporary signed URL using URL::temporarySignedRoute('dev.login', ...)
  2. When visited, the signed middleware verifies the URL hasn't been tampered with or expired
  3. 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_DRIVER set in .env (e.g., database, file, cookie)
  • The sessions table migrated if using database driver
  • The /dev-login/{user} route uses the web middleware 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 web guard and users provider)
  • 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 我们能提供哪些服务?
定制开发 / 二次开发

基于 agile-creative-minds/laravel-dev-login-link 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 24
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-05