Download the PHP package bogardo/multiauth without Composer

On this page you can find all versions of the php package bogardo/multiauth. 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 multiauth

Bogardo\Multiauth

Latest Stable Version MIT License Build Status Coverage Status Packagist Downloads Total Packagist Downloads Month

Laravel authentication driver which enables you to use multiple Eloquent models for authentication.

This package supports Laravel's password reminders by default and needs no extra configuration.

Installation

Currently only compatible with Laravel 4.2
Support for Laravel 5 is on the roadmap

Install the package with composer

$ composer require bogardo\multiauth

Add the service provider

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

'Bogardo\Multiauth\MultiauthServiceProvider',

Configuration

Change the following in your app/config/auth.php file.

Set your driver to multiauth

Add your multiauth settings

Usage

Prepare your models

There are 2 things that must be changed in your models

  1. Add the Bogardo\Multiauth\User\UserTrait (replace it if it is already present)
  2. Add a public $authtype property. The value of the property should match the type key defined in the multiauth configuration.

Examples

User model
Admin model

Validation

When working with just one table for users you'd normally only check for unique emails/usernames in your users table. But when you're working with multiple tables you have to make sure that your emails/usernames are unique on all relevant tables.

This package provides a convient validation rule to do exactly that.

It will check if the supplied value (email/username) exists on any of the tables defined in the multiauth configuration. It will take note of the identifier (email/username/custom) defined in the configuration.

When using the rule without extra parameters it will make sure the supplied value does not exist in any of the tables. You'd probably use this for creating new users.

When updating an existing user you'd want to check if the supplied value is unique except for the record you are updating. You can do this by supplying two parameters:

Usage

Creating new record

Updating an existing Admin user with an id of 5

API

Get the Multiauth service

Get a collection of all registered entities The EntityCollection extends Laravel's Collection

Get an entity by type


Filters example implementation

You could use this, for example, to create custom route filters for each user type.

This will create a route filter for every registered user type:

Which you could use to restrict access to a route which should only be accessible for a specific user type.

FAQ

- I'm unable to login using the loginUsingId and onceUsingId methods

The loginUsingId() and onceUsingId() methods should be passed the type and the id of the user, separated by a dot. This deviates from the default usage, where you'd only have to pass the ID of the user.


Changelog

v0.2.0

v0.1.0

v0.0.1

Todo


All versions of multiauth with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
illuminate/support Version 4.2.*
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 bogardo/multiauth contains the following files

Loading the files please wait ....