PHPackages                             equidna/swift-auth - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. equidna/swift-auth

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

equidna/swift-auth
==================

Bottled authentication for Laravel projects

3.0.0(4mo ago)028MITPHPPHP ^8.2 || ^8.3 || ^8.4CI failing

Since Nov 17Pushed 4mo agoCompare

[ Source](https://github.com/EquidnaMX/swift_auth)[ Packagist](https://packagist.org/packages/equidna/swift-auth)[ RSS](/packages/equidna-swift-auth/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (12)Versions (7)Used By (0)

SwiftAuth
=========

[](#swiftauth)

**Bottled authentication for Laravel projects.**

SwiftAuth is a production-ready authentication package for Laravel that provides a robust, secure, and flexible identity management system. It supports traditional session-based auth, multi-factor authentication (OTP &amp; WebAuthn/Passkeys), role-based access control, and comprehensive session management.

This package is designed to be a drop-in solution for Laravel applications requiring enterprise-grade authentication features without the boilerplate.

---

Documentation Index
-------------------

[](#documentation-index)

- [Deployment Instructions](doc/deployment-instructions.md)
- [Securing Routes](doc/securing-routes.md) **← Session &amp; API Token Authentication**
- [API Documentation](doc/api-documentation.md) (Public Endpoints)
- [Routes Documentation](doc/routes-documentation.md)
- [Artisan Commands](doc/artisan-commands.md)
- [Tests Documentation](doc/tests-documentation.md)
- [Architecture Diagrams](doc/architecture-diagrams.md)
- [Monitoring](doc/monitoring.md)
- [Business Logic &amp; Core Processes](doc/business-logic-and-core-processes.md)
- [Open Questions &amp; Assumptions](doc/open-questions-and-assumptions.md)

> This documentation and the codebase follow the project’s **Coding Standards Guide** and **PHPDoc Style Guide**.

Tech Stack &amp; Requirements
-----------------------------

[](#tech-stack--requirements)

- **Type:** Laravel Package
- **PHP:** 8.2+
- **Laravel:** 11.x / 12.x
- **Key Dependencies:**
    - `equidna/bird-flock` (Notification Bus)
    - `laragear/webauthn` (Passkey Support)
    - `inertiajs/inertia-laravel` (Frontend Interop)

Quick Start
-----------

[](#quick-start)

1. **Install the package:**

    ```
    composer require equidna/swift-auth
    ```
2. **Publish assets and configuration:**

    ```
    php artisan swift-auth:install
    ```

    This will publish the config file (`config/swift-auth.php`), migrations, and frontend assets.
3. **Run migrations:**

    ```
    php artisan migrate
    ```
4. **Create an initial admin user:**

    ```
    php artisan swift-auth:create-admin-user
    ```
5. **Serve and visit:**

    Start your server:

    ```
    php artisan serve
    ```

    Visit `/swift-auth/login` (or your configured route prefix) to see the login page.

Localization
------------

[](#localization)

SwiftAuth includes full localization support for **English** and **Spanish**. Users can dynamically switch languages through a UI component, and the package automatically persists their preference in the session.

### Supported Languages

[](#supported-languages)

- **English (en)** - Default
- **Spanish (es)**

### Features

[](#features)

- Dynamic language switching via `LanguageSwitcher` component
- Session-based locale persistence
- All UI elements, emails, and notifications are fully translated
- Translation files organized by module (auth, email, session, user, role)

### Usage

[](#usage)

**In PHP/Blade:**

```
{{ __('swift-auth::auth.login_title') }}
@lang('swift-auth::email.verification_button')
```

**In JavaScript/TypeScript:**

```
import { __ } from "../../../lang/translations";
{__("auth.login_title")};
```

For comprehensive localization documentation, including how to add new languages and customize translations, see [Localization Guide](doc/localization.md).

Securing Routes
---------------

[](#securing-routes)

SwiftAuth provides two authentication systems:

**Session Authentication (Web):**

```
Route::middleware('SwiftAuth.RequireAuthentication')->group(function () {
    Route::get('/dashboard', [DashboardController::class, 'index']);
});

// With role-based access
Route::middleware([
    'SwiftAuth.RequireAuthentication',
    'SwiftAuth.CanPerformAction:admin-panel',
])->group(function () {
    Route::get('/admin', [AdminController::class, 'index']);
});
```

**API Token Authentication:**

```
Route::middleware('SwiftAuth.AuthenticateWithToken')->group(function () {
    Route::get('/api/posts', [PostController::class, 'index']);
});

// With ability-based access
Route::middleware([
    'SwiftAuth.AuthenticateWithToken',
    'SwiftAuth.CheckTokenAbilities:posts:create',
])->group(function () {
    Route::post('/api/posts', [PostController::class, 'store']);
});
```

For complete examples, testing strategies, and best practices, see **[Securing Routes Guide](doc/securing-routes.md)**.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance74

Regular maintenance activity

Popularity7

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~11 days

Total

5

Last Release

139d ago

Major Versions

1.0.2 → 2.0.02025-12-15

2.0.0 → 3.0.02025-12-31

PHP version history (2 changes)1.0.0PHP ^8.2

2.0.0PHP ^8.2 || ^8.3 || ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/21aa1f99daa17783331e507c7fa7ffd1fb5d9e93450069209d2c43e6d5c8ca1a?d=identicon)[gruelas](/maintainers/gruelas)

---

Top Contributors

[![raulcruzTU](https://avatars.githubusercontent.com/u/142824075?v=4)](https://github.com/raulcruzTU "raulcruzTU (42 commits)")[![gruelasjr](https://avatars.githubusercontent.com/u/40619710?v=4)](https://github.com/gruelasjr "gruelasjr (39 commits)")[![memoola49](https://avatars.githubusercontent.com/u/55213964?v=4)](https://github.com/memoola49 "memoola49 (15 commits)")[![GerardoResendiz](https://avatars.githubusercontent.com/u/92111855?v=4)](https://github.com/GerardoResendiz "GerardoResendiz (14 commits)")[![vicario00](https://avatars.githubusercontent.com/u/101902535?v=4)](https://github.com/vicario00 "vicario00 (9 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (6 commits)")[![karlyoz](https://avatars.githubusercontent.com/u/54610989?v=4)](https://github.com/karlyoz "karlyoz (6 commits)")[![LauraRivera1607](https://avatars.githubusercontent.com/u/147354444?v=4)](https://github.com/LauraRivera1607 "LauraRivera1607 (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/equidna-swift-auth/health.svg)

```
[![Health](https://phpackages.com/badges/equidna-swift-auth/health.svg)](https://phpackages.com/packages/equidna-swift-auth)
```

###  Alternatives

[codegreencreative/laravel-samlidp

Make your PHP Laravel application an Identification Provider using SAML 2.0. This package allows you to implement your own Identification Provider (idP) using the SAML 2.0 standard to be used with supporting SAML 2.0 Service Providers (SP).

263763.5k1](/packages/codegreencreative-laravel-samlidp)[hasinhayder/tyro

Tyro - The ultimate Authentication, Authorization, and Role &amp; Privilege Management solution for Laravel 12 &amp; 13

6712.1k2](/packages/hasinhayder-tyro)[truckersmp/steam-socialite

Laravel Socialite provider for Steam OpenID.

1516.7k](/packages/truckersmp-steam-socialite)[pschocke/laravel-telegram-login-widget

Easily integrate Telegrams login widget into your Laravel application to send Telegram messages

1610.4k](/packages/pschocke-laravel-telegram-login-widget)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
