2017 © Pedro Peláez
 

library laravel-multiauth

Authenticate using multiple sources.

image

askedio/laravel-multiauth

Authenticate using multiple sources.

  • Wednesday, June 1, 2016
  • by gcphost
  • Repository
  • 1 Watchers
  • 0 Stars
  • 20 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

screen shot, (*1)

Laravel Multi Auth

Authenticate your Laravel 5 applications with email/password, email link, socialite and custom drivers. Demo & Example app., (*2)

This package extends the default auth system with a custom guard, views and routes., (*3)

Installation

Install with composer.

composer require askedio/laravel-multiauth

Enable

Edit config/app.php, (*4)

Register the provider and alias, (*5)

 Askedio\MultiAuth\MultiAuthServiceProvider::class,

~~~ 'MultiAuth' => Askedio\MultiAuth\Facades\MultiAuth::class,, (*6)


## Publish & migrate Please note: The `users` table needs some [new fields](https://github.com/Askedio/laravel-multiauth/blob/master/database/migrations/2014_10_12_000000_add_users_table.php) & a [table](https://github.com/Askedio/laravel-multiauth/blob/master/database/migrations/2016_05_24_000000_create_user_oauth_table.php) for the tokens.

php artisan vendor:publish php artisan migrate, (*7)


# Laravel Auth Make the Laravel auth system.

php artisan make:auth, (*8)


## Configure Routes Edit `app/Http/routes.php` Add the following line.

MultiAuth::route(); ~~~~, (*9)

Configure User Model

Edit app\User.php, (*10)

Change fillable to read., (*11)

protected $fillable = [
      'name', 'email', 'password', 'avatar', 'nickname', 'confirmed',
];

Add the oauth relation., (*12)

public function oauth()
{
    return $this->hasMany(\Askedio\MultiAuth\Models\UserOauth::class);
}

Configure Auth Guards & Providers

Edit config/auth.php, (*13)

Add to the guards array, (*14)

'multiAuth' => [
    'driver'   => 'session',
    'provider' => 'multiAuth',
],

Add to the providers array, (*15)

'multiAuth' => [
    'driver' => 'multiAuth',
    'model'  => App\User::class,
],

Configure your template

Edit resources/views/auth/login.blade.php, (*16)

Replace content with the multiauth::login login form., (*17)

@extends('layouts.app')

@section('content')
  @include('multiauth::login')
@endsection

Configure Socialite

Edit config/services.php, (*18)

Add all the services you want., (*19)

'facebook' => [
    'client_id'     => env('FACEBOOK_CLIENT_ID'),
    'client_secret' => env('FACEBOOK_CLIENT_SECRET'),
    'redirect'      => env('APP_URL').'/auth/facebook/callback',
],

Edit .env and add all the settings., (*20)

FACEBOOK_CLIENT_ID=
FACEBOOK_CLIENT_SECRET=

The Versions

01/06 2016

dev-master

9999999-dev

Authenticate using multiple sources.

  Sources   Download

MIT

The Requires

 

laravel

30/05 2016

v1.2

1.2.0.0

Authenticate using multiple sources.

  Sources   Download

MIT

The Requires

 

laravel

30/05 2016

v1.0

1.0.0.0

Authenticate using multiple sources.

  Sources   Download

MIT

The Requires

 

laravel