PHPackages                             ahmedebead/laramultiauth - 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. ahmedebead/laramultiauth

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

ahmedebead/laramultiauth
========================

LaraMultiAuth is a versatile Laravel package designed to simplify the implementation of multiple authentication systems within a single Laravel application.

v1.1.4(1y ago)223MITPHPPHP ^8.1

Since Aug 3Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ahmed3bead/LaraMultiAuth)[ Packagist](https://packagist.org/packages/ahmedebead/laramultiauth)[ RSS](/packages/ahmedebead-laramultiauth/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (21)Used By (0)

LaraMultiAuth Package Documentation (still under development)
=============================================================

[](#laramultiauth-package-documentation-still-under-development)

[![LaraMultiAuth Logo](https://github.com/ahmed3bead/LaraMultiAuth/raw/master/ae.png)](https://github.com/ahmed3bead/LaraMultiAuth/blob/master/ae.png)

- [Introduction](#1-introduction)
- [Installation](#2-installation)
- [Configuration](#3-configuration)
- [Usage](#4-usage)
- [Models Implementation](#5-models-implementation)
- [Helper Functions](#6-helper-functions)
- [Create Helper File](#7-create-helper-file)
- [API and Web Authentication](#8-api-and-web-authentication)
- [License](#9-license)

1. Introduction
---------------

[](#1-introduction)

LaraMultiAuth is a versatile Laravel package designed to simplify the implementation of multiple authentication systems within a single Laravel application. It provides a streamlined solution for managing different types of user authentication, enabling you to support various user roles and authentication methods with ease. It supports both API and web authentication, including multi-guard setups and OTP verification for email and phone.

2. Installation
---------------

[](#2-installation)

To install the `LaraMultiAuth` package, follow these steps:

1. **Add the Package to Your Project**

    ```
    composer require ahmedebead/laramultiauth
    ```

Setup
-----

[](#setup)

After installing the package, run the following command to complete the setup:

```
php artisan multiauth:setup
php artisan passport:install # If needed
```

2. **Register the Service Provider**

    Add the following line to the `providers` array in `config/app.php`:

    ```
    AhmedEbead\LaraMultiAuth\LaraMultiAuthServiceProvider::class,
    ```
3. **Publish the Configuration File**

    ```
    php artisan vendor:publish --provider="AhmedEbead\LaraMultiAuth\LaraMultiAuthServiceProvider"
    ```

3. Configuration
----------------

[](#3-configuration)

Update the `config/multiauth.php` file to configure models and SMS helper functions:

```
