Download the PHP package skywalker-labs/passwordless without Composer

On this page you can find all versions of the php package skywalker-labs/passwordless. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package passwordless

Skywalker Passwordless — OTP & Magic Link Authentication

Version Total Downloads PHPStan Level 9 PHP Version

Elegant passwordless authentication for Laravel. Drop-in OTP login, 2FA enforcement, magic links, and backup codes — all built on Skywalker Toolkit with action-oriented architecture, contract-based design, and Extreme Strictness (PHPStan Level 9 + Strict Rules) compliance.


✨ Features

Feature Detail
OTP Login Generate & verify time-limited one-time passwords
Hashed Storage OTPs and backup codes stored with Hash::make() — never plain-text
Magic Login Links Signed, temporary URLs for one-click authentication
Backup Codes Hashed emergency recovery codes
Multi-Channel Email, SMS (Twilio), Slack, and Log channels
Event-Driven OtpGenerated, OtpVerified, OtpFailed events for full extensibility
Middleware Gate otp.verified middleware with infinite-loop protection
Rate Limiting Built-in per-identifier request throttling on all routes
Action Architecture Each operation is a dedicated Action class (SRP)
Extreme Strictness 100% compliance with PHPStan Level 9 + Strict & Deprecation rules
Zero-Trust Auth Risk-based trust scoring (TrustEngine) integrated into the core flow
Strict Types declare(strict_types=1) and explicit type comparisons everywhere

📦 Installation

Requires: PHP ≥ 8.2, Laravel ≥ 11.0


🛠️ Setup

1. Add the HasOtp Trait to Your User Model

The trait provides sendOtp(): string and verifyOtp(string $token): bool methods.

2. Publish Config & Migrations

3. Configure (config/passwordless.php)


🎯 Usage

Using the Facade

Dependency Injection (Recommended)

Inject the contract for testable, SOLID-compliant code:

Magic Login Links

Backup Codes

Custom OTP Generator

Listen to Events

Middleware Gate

Add the otp.verified middleware to any route to enforce OTP verification before access:

The middleware automatically:


🏗️ Architecture

The package follows a strict Action-Oriented + Domain-Driven architecture:

Toolkit foundation:

Our Class Extends
All 5 Action classes Skywalker\Support\Foundation\Action
OtpToken Skywalker\Support\Foundation\ValueObject
OtpException Skywalker\Support\Exceptions\PackageException
OtpService Skywalker\Support\Foundation\Service
OtpServiceProvider Skywalker\Support\Providers\PackageServiceProvider

🧪 Testing & Analysis


🔒 Security & Quality


🔒 Zero-Trust Security

This package integrates the Skywalker Trust Engine to provide risk-based authentication:

  1. Trust Scoring: Every authentication attempt calculates a "Trust Score" (0.0 to 1.0) based on IP, behavior, and environment.
  2. Adaptive 2FA: If a user has a very high trust score (e.g. > 0.8), the otp.verified middleware can be configured to bypass the OTP check (bypass_high_trust).
  3. Hijack Protection: If a session's trust score drops significantly mid-session, the user is automatically prompted for re-verification.
  4. Session Rotation: Sessions are regenerated upon successful OTP or Magic Link verification to prevent fixation attacks.

🛣️ Available Routes

Method URI Name Auth
POST /otp/send otp.send Public
POST /otp/verify otp.verify Public
GET /otp/verify otp.verify.view auth
POST /otp/verify-submit otp.verify.submit auth
POST /otp/resend otp.resend auth
GET /magic-login passwordless.magic-login Signed URL

📄 License

The MIT License (MIT). Please see License File.


All versions of passwordless with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
skywalker-labs/toolkit Version ^1.6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package skywalker-labs/passwordless contains the following files

Loading the files please wait ...