PHPackages                             ashtech/laravel-auth-kit - 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. ashtech/laravel-auth-kit

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

ashtech/laravel-auth-kit
========================

Starter-ready Laravel authentication kit — Blade UI, Sanctum API, OTP, multi-vendor roles, and email/phone verification.

v1.0.1(4d ago)15MITPHP ^8.3

Since Jul 7Compare

[ Source](https://github.com/ahmed29920/auth-pack)[ Packagist](https://packagist.org/packages/ashtech/laravel-auth-kit)[ Docs](https://github.com/ashtech/laravel-auth-kit)[ RSS](/packages/ashtech-laravel-auth-kit/feed)WikiDiscussions Synced today

READMEChangelogDependencies (10)Versions (3)Used By (0)

Ashtech Laravel Auth Kit
========================

[](#ashtech-laravel-auth-kit)

Starter-ready authentication for **Laravel 11–13** — Blade UI, REST API, roles, OTP, and email/phone verification.

**Packagist:** [`ashtech/laravel-auth-kit`](https://packagist.org/packages/ashtech/laravel-auth-kit)

```
composer require ashtech/laravel-auth-kit
```

> **Note:** Legacy packages [`kango/auth`](https://packagist.org/packages/kango/auth) (`Kango\Auth`) remain for older projects. This package uses the `Ashtech\LaravelAuthKit` namespace.

Requirements
------------

[](#requirements)

- PHP `^8.3`
- Laravel `^11.0`, `^12.0`, or `^13.0`
- Node.js &amp; npm (host app — required for Blade UI assets via Vite)
- [laravel/sanctum](https://github.com/laravel/sanctum) `^4.0` (required dependency; host app must run Sanctum migrations)
- [spatie/laravel-translatable](https://github.com/spatie/laravel-translatable) `^6.14` (installed automatically with this package)

Features
--------

[](#features)

- Registration, login, logout (web session + API Sanctum tokens)
- Email/password and phone/password (configurable per project)
- OTP via phone or email (login, register, password reset, verification)
- Hashed OTP storage with attempt limiting
- Roles: `super_admin`, `admin`, `vendor`, `vendor_staff`, `customer`, `delivery`
- **Enum roles** (default, `role` column) or **Spatie Permission** (`role_driver=spatie`)
- Guest locale switcher on auth pages (`en` / `ar`)
- Swappable SMS provider for OTP (`SmsSenderInterface`)
- Web and API clients can be enabled or disabled independently

---

Installing the package
----------------------

[](#installing-the-package)

### From Packagist (recommended)

[](#from-packagist-recommended)

```
composer require ashtech/laravel-auth-kit
```

### From a private Git repository

[](#from-a-private-git-repository)

Add the repository to the host app `composer.json`, then require the package:

```
"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/ashtech/laravel-auth-kit"
    }
],
"minimum-stability": "stable",
"prefer-stable": true
```

```
composer require ashtech/laravel-auth-kit:^1.0
```

Use a tagged release (e.g. `v1.0.0`). The `@dev` constraint is only for local monorepo development.

### Migrating from legacy packages

[](#migrating-from-legacy-packages)

Legacy packageOld namespaceNew package`kango/auth``Kango\Auth``ashtech/laravel-auth-kit``ahmed-ashraf/auth``AhmedAshraf\Auth``ashtech/laravel-auth-kit`In host apps:

1. `composer require ashtech/laravel-auth-kit`
2. Update imports to `use Ashtech\LaravelAuthKit\...`
3. Extend `Ashtech\LaravelAuthKit\Models\User`
4. Rename env vars from `AUTH_PACKAGE_*` to `AUTH_KIT_*`
5. Publish config tag `laravel-auth-kit-config` if you published the old config

---

Host application setup
----------------------

[](#host-application-setup)

### 1. Publish and migrate Sanctum

[](#1-publish-and-migrate-sanctum)

Sanctum is installed with this package, but the host app must publish its config/migrations:

```
php artisan vendor:publish --provider="Laravel\Sanctum\SanctumServiceProvider"
php artisan migrate
```

This creates Sanctum’s `personal_access_tokens` table (required for API auth).

### 2. Publish package config (optional)

[](#2-publish-package-config-optional)

```
php artisan vendor:publish --tag=laravel-auth-kit-config
```

Available publish tags:

TagPurpose`laravel-auth-kit-config``config/laravel-auth-kit.php``laravel-auth-kit-migrations`Copy migrations into `database/migrations` (only if you need to customize them)`laravel-auth-kit-views`Copy Blade views into `resources/views/vendor/laravel-auth-kit`By default, migrations and views are loaded from the package — publishing is optional.

### 3. Database migrations

[](#3-database-migrations)

The package registers migrations that extend a standard Laravel app:

- **users** — adds `phone`, `role`, `vendor_id`, `phone_verified_at`, `is_active`, soft deletes (works with Laravel’s default `users` table)
- **otps** — hashed OTP codes
- **password\_reset\_tokens** — skipped automatically if Laravel already created it

No need to remove Laravel’s default migrations. Run:

```
php artisan migrate
```

### 4. User model

[](#4-user-model)

Create or update `app/Models/User.php`:

```
