Download the PHP package ahmedebead/laramultiauth without Composer

On this page you can find all versions of the php package ahmedebead/laramultiauth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laramultiauth

LaraMultiAuth Package Documentation (still under development)

LaraMultiAuth Logo

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

To install the LaraMultiAuth package, follow these steps:

  1. Add the Package to Your Project

Setup

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

  1. Register the Service Provider

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

  2. Publish the Configuration File

3. Configuration

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

4. Usage

Use the package functions via the LaraMultiAuth facade:

Login with Email/phone or any another fields -- check config fields

Register a New User

Generate and Verify OTP

Generate and Send OTP

here if you pass phone number sms logic will run if you pass email will sent to given email

will return

or

Get Current logged in user data

Logout

Forget Password

Reset Password

Or you can add any fields name, but you must create otp by this field data

if you don't need to verify otp on reset password just pass false as second argument

5. Models Implementation

BaseAuthModel

The AhmedEbead\LaraMultiAuth\Models\BaseAuthModel provides common authentication functionalities.

Concrete Models

Extend BaseAuthModel for each guard.

Web User Model

API User Model

Admin User Model

6. Helper Functions

Example SMS Helper Function

Add this helper function to your project as a helper function to handle SMS sending:

7. Create Helper File

A. Create a New Helper File

The first step to creating a helper in Laravel 10 is to create a new file in the app/Helpers directory. If this directory doesn't exist, create it.

B. Add the Helper Function

Once you’ve created the new helper file, you can add your helper function. A helper function is just a regular PHP function that you can call from anywhere in your Laravel application.

C. Load the Helper File

After you’ve defined your helper function, you need to load the helper file so that Laravel knows about it. You can do this by adding an autoload entry to the composer.json file in your Laravel application. Open the composer.json file and add the following entry to the autoload section:

D. Use the Helper Function

Now that you’ve defined your helper function and loaded the helper file, you can use the function anywhere in your Laravel application. For example, if you want to format a date string in your controller, you could do the following:

8. API and Web Authentication

The package supports both API (using Laravel Passport) and web authentication. The guard type determines the authentication method:

The authentication methods are dynamically handled based on the guard specified in the configuration.

9. License

The LaraMultiAuth package is licensed under the MIT License. See the LICENSE file for more information.


All versions of laramultiauth with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
laravel/framework Version ^10.0
ichtrojan/laravel-otp Version ^2.0
laravel/passport Version ^11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ahmedebead/laramultiauth contains the following files

Loading the files please wait ....