PHPackages                             kango/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. kango/auth

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

kango/auth
==========

Multi-vendor authentication package with roles, OTP, email/phone verification (Blade + API). Spatie Permission compatible.

v1.0.2(2mo ago)07MITPHPPHP ^8.3

Since May 19Pushed 2mo agoCompare

[ Source](https://github.com/ahmed29920/auth-pack-freeze)[ Packagist](https://packagist.org/packages/kango/auth)[ RSS](/packages/kango-auth/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (8)Versions (4)Used By (0)

Kango Auth
==========

[](#kango-auth)

Multi-vendor authentication for **Laravel 13** — Blade UI, REST API, roles, OTP, and email/phone verification.

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

[](#requirements)

- PHP `^8.3`
- Laravel `^12.0`
- [laravel/sanctum](https://github.com/laravel/sanctum) `^4.0` (API tokens)
- [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)
- 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`)

---

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

[](#installing-the-package)

### From Packagist (recommended)

[](#from-packagist-recommended)

After the package is published:

```
composer require kango/auth
```

### 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/your-org/kango-auth"
    }
],
"minimum-stability": "stable",
"prefer-stable": true
```

```
composer require kango/auth:^1.0
```

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

---

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

[](#host-application-setup)

### 1. Install Sanctum and run migrations

[](#1-install-sanctum-and-run-migrations)

```
composer require laravel/sanctum
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=kango-auth-config
```

Available publish tags:

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

### 3. Users table / migrations

[](#3-users-table--migrations)

The package registers migrations for:

- `users` (with `role`, `phone`, `vendor_id`, verification timestamps, soft deletes)
- `auth_package_otps`
- `auth_package_password_reset_tokens`

> **Important:** If your Laravel app already has a default `create_users_table` migration, **remove or skip it** before running `php artisan migrate` to avoid a duplicate `users` table error. This package owns the `users` schema for auth.

Then migrate:

```
php artisan migrate
```

### 4. User model

[](#4-user-model)

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

```
