PHPackages                             mediadotonedev/userauthcenter - 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. mediadotonedev/userauthcenter

ActiveLaravel-package[Authentication &amp; Authorization](/categories/authentication)

mediadotonedev/userauthcenter
=============================

A Laravel package for user authentication with OTP and password

05PHP

Since Jun 11Pushed 10mo agoCompare

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

READMEChangelogDependenciesVersions (2)Used By (0)

UserAuthCenter - Laravel User Authentication Package
====================================================

[](#userauthcenter---laravel-user-authentication-package)

UserAuthCenter is a comprehensive Laravel package designed to provide robust user authentication functionalities, including OTP (One-Time Password) and traditional password-based authentication. This package aims to simplify the integration of advanced authentication features into your Laravel applications.

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Configuration](#configuration)
- [Database Migrations](#database-migrations)
- [Publishing Files](#publishing-files)
    - [Configuration File](#configuration-file)
    - [Controllers](#controllers)
    - [Requests](#requests)
    - [Rules](#rules)
    - [Models](#models)
    - [Services](#services)
    - [Swagger Configuration](#swagger-configuration)
    - [All Publishable Files](#all-publishable-files)
- [Usage](#usage)
    - [API Routes](#api-routes)
    - [Extending Functionality](#extending-functionality)
- [Contribution](#contribution)
- [License](#license)

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

[](#installation)

To install UserAuthCenter, require it via Composer in your Laravel project:

```
composer require mediadotonedev/userauthcenter:dev-main
php artisan vendor:publish --tag=userauthcenter-config
php artisan vendor:publish --tag=userauthcenter-controllers
php artisan vendor:publish --tag=userauthcenter-requests
php artisan vendor:publish --tag=userauthcenter-rules
php artisan vendor:publish --tag=userauthcenter-migrations
php artisan migrate
php artisan vendor:publish --tag=userauthcenter-models --force
php artisan vendor:publish --tag=userauthcenter-services
php artisan l5-swagger:generate
```

After installing the package, Laravel will automatically discover the package's service provider. No manual registration is required for Laravel versions 5.5 and above.

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

[](#configuration)

The package comes with a configurable file `userauthcenter.php`. You can publish this configuration file to your application's `config` directory to customize its settings.

To publish the configuration file, run:

```
php artisan vendor:publish --tag=userauthcenter-config
```

This will copy `vendor/mediadotonedev/userauthcenter/src/config/userauthcenter.php` to `config/userauthcenter.php`.

Database Migrations
-------------------

[](#database-migrations)

This package includes its own database migrations for user-related tables or modifications. It's crucial to run these migrations to set up your database correctly.

First, you can publish the migrations to your application's `database/migrations` directory:

```
php artisan vendor:publish --tag=userauthcenter-migrations
```

After publishing, run your database migrations:

```
php artisan migrate
```

**Note:** If you already have a `users` table, the package's migration (`update_users_table.php`) might attempt to modify it. Review the migration file to ensure it aligns with your existing database schema.

Publishing Files
----------------

[](#publishing-files)

UserAuthCenter allows you to publish several of its internal files to your application. This is useful if you need to modify or extend the package's core logic or components directly.

### Configuration File

[](#configuration-file)

As mentioned above, to publish the configuration file:

```
php artisan vendor:publish --tag=userauthcenter-config
```

### Controllers

[](#controllers)

To publish the `UserAuthController.php` to `app/Http/Controllers/`:

```
php artisan vendor:publish --tag=userauthcenter-controllers
```

### Requests

[](#requests)

To publish all validation request files to `app/Http/Requests/`:

```
php artisan vendor:publish --tag=userauthcenter-requests
```

### Rules

[](#rules)

To publish custom validation rules (e.g., `EmailOrIranianMobile.php`) to `app/Rules/`:

```
php artisan vendor:publish --tag=userauthcenter-rules
```

### Models

[](#models)

To publish the `User.php` model to `app/Models/`:

```
php artisan vendor:publish --tag=userauthcenter-models --force
```

**Important:** Publishing the `User.php` model might conflict with your existing `App\Models\User.php`. Exercise caution and merge changes manually if necessary, or consider using a different model name within your package if a direct conflict is undesirable.

### Services

[](#services)

To publish service classes (e.g., `UserAuthService.php`, `UserService.php`) to `app/Services/`:

```
php artisan vendor:publish --tag=userauthcenter-services
```

### Swagger Configuration

[](#swagger-configuration)

If your package includes Swagger/OpenAPI documentation, you can publish its configuration:

```
php artisan l5-swagger:generate
```

### All Publishable Files

[](#all-publishable-files)

To publish all the above-mentioned files (config, migrations, controllers, requests, rules, models, services, swagger config) with a single command:

```
php artisan vendor:publish --provider="Mediadotonedev\UserAuthCenter\UserauthcenterServiceProvider"
```

Or, if you define an `userauthcenter-all` tag in your ServiceProvider:

```
php artisan vendor:publish --tag=userauthcenter-all
```

### API Config

[](#api-config)

add environment packacage connect to api append .env file.

```
USERAUTHCENTER_API_KEY=
USERAUTHCENTER_API_URL=
```

Usage
-----

[](#usage)

### API Routes

[](#api-routes)

The package provides its own API routes for authentication. These routes are automatically loaded by the package and do not overwrite your application's `routes/api.php`.

The API routes are defined in `vendor/mediadotonedev/userauthcenter/src/routes/userauthcenter_api.php`. You can inspect this file to see the available endpoints.

Typically, these routes would handle:

- User registration (with or without OTP)
- User login (password-based or OTP-based)
- OTP generation and verification
- Password reset functionalities

**Example:** If your package defines `/api/auth/register`, you can access it directly after installation.

### Extending Functionality

[](#extending-functionality)

Since you can publish various components like controllers, requests, rules, and models, you have the flexibility to extend or override the package's default behavior by modifying the published files.

update package
--------------

[](#update-package)

```
composer dump-autoload
php artisan config:clear
```

Contribution
------------

[](#contribution)

Feel free to contribute to the UserAuthCenter package. Bug reports, feature requests, and pull requests are welcome.

License
-------

[](#license)

The UserAuthCenter package is open-sourced software licensed under the MIT license.

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity16

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/205085bfb5031209d63f89849411b510e875d9f2bb2863ed93be822c866af16a?d=identicon)[mediadotonedev](/maintainers/mediadotonedev)

---

Top Contributors

[![khaliilii](https://avatars.githubusercontent.com/u/29864938?v=4)](https://github.com/khaliilii "khaliilii (58 commits)")

### Embed Badge

![Health badge](/badges/mediadotonedev-userauthcenter/health.svg)

```
[![Health](https://phpackages.com/badges/mediadotonedev-userauthcenter/health.svg)](https://phpackages.com/packages/mediadotonedev-userauthcenter)
```

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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