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

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

mahbubur508/api-auth
====================

A robust and fast REST API Authentication package for Laravel using Sanctum.

v1.0.0(yesterday)01↑2900%MITPHPPHP ^8.2

Since Jun 10Pushed yesterdayCompare

[ Source](https://github.com/mahbubur508/api-auth)[ Packagist](https://packagist.org/packages/mahbubur508/api-auth)[ RSS](/packages/mahbubur508-api-auth/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

🚀 Laravel API Auth
==================

[](#-laravel-api-auth)

[![Latest Stable Version](https://camo.githubusercontent.com/ff18a97f667c9396fb968d071bf065d8177a904c7e253dca7fa6a53d6d44451f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d616862756275723530382f6170692d617574682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mahbubur508/api-auth)[![Total Downloads](https://camo.githubusercontent.com/42948aac281e57b0a233b14d196fdd1e5cdb87f4cf1a528fd205896f065ee7ed/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d616862756275723530382f6170692d617574682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mahbubur508/api-auth)[![License](https://camo.githubusercontent.com/442801b49dcb1234d67c7d587875aabf0a3676bfcbfae31339b6366d16033e13/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d616862756275723530382f6170692d617574682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mahbubur508/api-auth)

A lightweight and secure REST API Authentication package for Laravel powered by **Laravel Sanctum**. Quickly add user registration, login, logout, and authenticated profile endpoints to your Laravel applications with minimal setup.

---

✨ Features
----------

[](#-features)

- 🔐 Laravel Sanctum powered authentication
- 🚀 Ready-to-use API endpoints
- 👤 User Registration
- 🔑 User Login
- 🚪 User Logout
- 🙍 Authenticated User Profile
- ⚙️ Configurable route prefixes
- 🎟️ Customizable token names
- 📦 Plug-and-play installation
- 📄 Consistent JSON responses

---

📋 Requirements
--------------

[](#-requirements)

- PHP 8.1+
- Laravel 10.x / 11.x / 12.x / 13.x
- Laravel Sanctum

---

📦 Installation
--------------

[](#-installation)

Install the package via Composer:

```
composer require mahbubur508/api-auth
```

---

⚙️ User Model Configuration
---------------------------

[](#️-user-model-configuration)

Ensure your `User` model uses Sanctum's `HasApiTokens` trait:

```
