承接 harrisonclewis/laravel-passwordless 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

harrisonclewis/laravel-passwordless

Composer 安装命令:

composer require harrisonclewis/laravel-passwordless

包简介

Passwordless authentication for Laravel

README 文档

README

Laravel Passwordless

Introduction

Passwordless authentication for Laravel. No passwords, no hassle. Users enter their email and receive a one-time login link.

Installation

Migrate an existing app

If you are replacing an existing Laravel auth flow, use the included PROMPT.md with your AI coding agent. It gives the agent package-specific instructions for installing this package, updating your auth UI, removing old password routes, preserving redirects and middleware, and verifying the magic-link flow.

Copy the contents of PROMPT.md into your AI coding agent.

Install Package

composer require harrisonclewis/laravel-passwordless

Run migrations:

php artisan migrate

Optional — publish the configurations

php artisan vendor:publish --tag=passwordless-config
php artisan vendor:publish --tag=passwordless-views

Usage

Sending authentication link

<form method="POST" action="{{ route('passwordless.store') }}">
    @csrf
    <input type="email" name="email" placeholder="you@example.com" />
    <button type="submit">Login</button>
</form>

@if (session(config('passwordless.flash')))
    <p>Check your email for a login link.</p>
@endif

For Inertia apps, you can use the flash prop page.flash.passwordless, or from the configured flash key if you changed passwordless.flash.

Routes

The package registers two routes automatically:

Method URI Description
POST /passwordless Accepts an email, creates and sends the magic link
GET /passwordless/{token} Consumes the token and authenticates the user

Point your login form at route('passwordless.store') and the rest is handled for you.

Registration

By default, users who don't have an account are created automatically when they submit their email. Disable this if you want to restrict login to existing users only:

// config/passwordless.php
'register' => false,

Configuration

// config/passwordless.php
return [
    'redirect'      => '/',           // Where to send the user after login
    'register'      => true,          // Auto-create users for unknown emails
    'token_lifetime' => 900,          // Link expiry in seconds (default: 15 min)
    
    ... others
];

Requirements

  • PHP ^8.1
  • Laravel ^10.0|^11.0|^12.0|^13.0

License

MIT

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固