PHPackages                             nizam/passport-api - 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. nizam/passport-api

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

nizam/passport-api
==================

Automates Laravel Passport setup for API authentication in Laravel 8 and higher, with ready-to-use routes and controllers. Similar to Laravel Breeze API.

V1.0.0(1y ago)29MITPHPPHP ^7.3|^8.0

Since Aug 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/nizaamomer/passport)[ Packagist](https://packagist.org/packages/nizam/passport-api)[ RSS](/packages/nizam-passport-api/feed)WikiDiscussions main Synced 1mo ago

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

Nizam Passport API
==================

[](#nizam-passport-api)

**Nizam Passport API** is a Laravel package designed to streamline API authentication setup using Laravel Passport. Compatible with Laravel versions 8, 9, 10, and 11, this package simplifies Passport integration by automating the installation and configuration process, making it ideal for API-only projects.

Features
--------

[](#features)

- **Automatic Laravel Passport Installation:** Ensures Passport is installed and configured. 🚀
- **API Authentication Scaffolding:** Provides necessary controllers, requests, and routes. 🛠️
- **Configuration Updates:** Automatically updates `api.php`, `web.php`, and appends to `auth.php` to use Passport. 🔧
- **User Model Update:** Adds the `HasApiTokens` trait to the User model. 👤
- **Environment Configuration:** Updates `.env` with default settings. 🌐
- **Auth Configuration Update:** Adds the API guard to the `auth.php` configuration file with the Passport driver if it’s not already present. This ensures your application uses Passport's TokenGuard for authenticating incoming API requests. 🛡️
- **Cleanup:** Removes unnecessary files and directories for API-only applications. 🗑️

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

[](#requirements)

- **PHP:** ^7.3|^8.0
- **Laravel:** ^8.0|^9.0|^10.0|^11.0
- **Laravel Passport:** ^10.0|^11.0|^12.0

Installation
------------

[](#installation)

1. **Install the Nizam Passport API package:**

    ```
    composer require nizam/passport-api
    ```
2. **Set up the Passport API:**

    ```
    php artisan nizam:install-passport-api
    ```

    This command will:

    - Check and install Laravel Passport if necessary
    - Set up required controllers, requests, and routes
    - Add the `HasApiTokens` trait to the User model
    - Update your `auth.php` configuration to use Passport as the API driver
    - Update your `web.php` and `api.php` configurations
    - Modify `.env` with default URL settings
    - Clean up unnecessary files and directories

Usage
-----

[](#usage)

This package provides the following API routes:

- **POST /api/auth/register:** Register a new user 📝
- **POST /api/auth/login:** Log in a user 🔑
- **POST /api/auth/logout:** Log out a user (requires authentication) 🚪
- **POST /api/auth/forgot-password:** Send a password reset link 📧
- **POST /api/auth/reset-password:** Reset the user's password 🔄
- **GET /api/auth/verify-email/{id}/{hash}:** Verify email address (requires authentication) ✔️
- **POST /api/auth/email/verification-notification:** Resend email verification notification (requires authentication) 🔄
- **GET /api/auth/user:** Get authenticated user information (requires authentication) 🧑‍💻

Configuration
-------------

[](#configuration)

After installation, ensure your application's `config/auth.php` configuration file includes an API authentication guard with the Passport driver. This configuration instructs your application to use Passport's TokenGuard for authenticating incoming API requests.

Examples
--------

[](#examples)

To see how the integration and setup have evolved, you can view the differences between versions in the repository commits. For specific examples of changes, check out the [commit history](https://github.com/nizaamomer/nizam-passport.example/commits/main/).

Reporting Issues
----------------

[](#reporting-issues)

If you encounter any issues or have suggestions for improvements, please follow these steps to report them:

1. **Check Existing Issues:** Before creating a new issue, check the [Issues](https://github.com/nizaamomer/passport-api/issues) tab to see if the issue has already been reported.
2. **Create a New Issue:** If the issue has not been reported, click on the "New Issue" button and provide a detailed description of the problem. Include:
    - A clear title
    - A detailed description of the issue
    - Steps to reproduce the issue
    - Any error messages or logs
    - The version of Laravel and Laravel Passport you are using
3. **Submit the Issue:** Once you have provided all the necessary information, submit the issue. The maintainers will review and address it as soon as possible.

License
-------

[](#license)

This package is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

Credits
-------

[](#credits)

- **Nizam Omer** - Package author and maintainer

Acknowledgements
----------------

[](#acknowledgements)

Thank you for using Nizam Passport API! Special thanks to My God, everyone who has contributed, tested, and provided feedback. Your support is greatly appreciated. May this package help you in your API development journey. 🙏

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Unknown

Total

1

Last Release

637d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/18573dfb5f9fc859cfef422a21b97cb09895e1a789097a858c739668ad064403?d=identicon)[nizaamomer](/maintainers/nizaamomer)

---

Top Contributors

[![nizaamomer](https://avatars.githubusercontent.com/u/98692798?v=4)](https://github.com/nizaamomer "nizaamomer (14 commits)")

---

Tags

apiauthenticationlaravelpassportrest-api

### Embed Badge

![Health badge](/badges/nizam-passport-api/health.svg)

```
[![Health](https://phpackages.com/badges/nizam-passport-api/health.svg)](https://phpackages.com/packages/nizam-passport-api)
```

###  Alternatives

[lab404/laravel-impersonate

Laravel Impersonate is a plugin that allows to you to authenticate as your users.

2.3k16.4M48](/packages/lab404-laravel-impersonate)[santigarcor/laratrust

This package provides a flexible way to add Role-based Permissions to Laravel

2.3k5.4M43](/packages/santigarcor-laratrust)[overtrue/laravel-follow

User follow unfollow system for Laravel.

1.2k404.7k5](/packages/overtrue-laravel-follow)[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)

PHPackages © 2026

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