aldo/laravel-passwordless-login
Composer 安装命令:
composer require aldo/laravel-passwordless-login
包简介
Log into your application using just a link
README 文档
README
A login link generator for Laravel
This package provides a temporary signed route that can be used to login a user. You can implement the login yourself or you can use the implementation provided by this package. It includes a must verify email registration and a passwordless login implementation.
Installation
composer require aldo/laravel-passwordless-login
Publish the config file
php artisan vendor:publish --tag=passwordless-config
Usage
In the published config file you should set the correct user model namespace and the name of the route that is going to be used to verify the generated login link. Your can also set the expiration time you want for the link.
<?php return [ /* | | The namespace of your applications user model | */ "model" => [ "namespace" => "\App\Models\User", ], /* | | The route name and the url expiration in minutes | */ "url" => [ "route" => "login.verify", "expire" => 5, ], /* |-------------------------------------------------------------------------------- | Only applicable if you are using the provided authentication implementation |-------------------------------------------------------------------------------- | | Change flag to true if you want to use the provided implementation routes. | This flag is necessary for not loading the routes if you don't want to use the default implementation. | This way you can avoid route collision. | | The name of the home route to redirect to after login | */ "routes" => [ "flag" => false, "home" => "home", ], ];
To generate the login link use the provided facade
use App\Models\User; use Aldo\LaravelPasswordlessLogin\Facades\PasswordlessLogin; function sendLoginLink() { $user = User::first(); $url = PasswordlessLogin::forUser($user)->generate(); // You can also add remember me (by default it's false) $url = PasswordlessLogin::forUser($user)->remember()->generate(); // Send the url to the user }
If you want to use the provided authentication implementation follow the steps below.
- Publish the migration files
php artisan vendor:publish --tag=passwordless-migrations
- Run the migrations
php artisan migrate
The packages migration modifies the users table making the password column nullable.
- In the config file change the flag to true and set the correct route name for your home page
/* |-------------------------------------------------------------------------------- | Only applicable if you are using the provided authentication implementation |-------------------------------------------------------------------------------- | | Change flag to true if you want to use the provided implementation routes. | This flag is necessary for not loading the routes if you don't want to use the default implementation. | This way you can avoid route collision. | | The name of the home route to redirect to after login | */ "routes" => [ "flag" => false, // change to true "home" => "home", ],
- In your user model implement
Illuminate\Contracts\Auth\MustVerifyEmail. The package uses it in the user registration.
If you want to publish the views and the localization files run:
php artisan vendor:publish --tag=passwordless-views
aldo/laravel-passwordless-login 适用场景与选型建议
aldo/laravel-passwordless-login 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 05 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「login」 「password」 「Passwordless」 「passwordless-login」 「laravel-passwordless-login」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 aldo/laravel-passwordless-login 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 aldo/laravel-passwordless-login 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 aldo/laravel-passwordless-login 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
WeChat OAuth SDK
Virgil is a stack of security libraries (ECIES with Crypto Agility wrapped in Virgil Cryptogram) and all the necessary infrastructure to enable seamless, end-to-end encryption for any application, platform or device. See below for currently available languages and platforms. Get in touch with us to
Virgil is a stack of security libraries (ECIES with Crypto Agility wrapped in Virgil Cryptogram) and all the necessary infrastructure to enable seamless, end-to-end encryption for any application, platform or device. See below for currently available languages and platforms. Get in touch with us to
Debugging a problem and need to login as one of your customers? This allows you to authenticate as any of your customers.
The PHP class PasswordGenerator serves as a password generator to create memorable passwords like the keychain of macOS ≤ 10.14 did.
Laravel middleware to restrict a site or specific routes using HTTP basic authentication
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2025-05-06