Sarav-S / Laravel-Multiauth

A Simple Laravel Package for handling multiple authentication
50 stars 8 forks source link

Fix issue #11 password reset #14

Closed JannieT closed 7 years ago

JannieT commented 8 years ago

Our project needs password reset functionality, so we hope you can accept this PR soon. Resolves issue #11

There are no tests for you to easily verify the behaviour, so I include our config/auth.php

<?php

return [

    'multi' => [
        'user' => [
            'driver' => 'eloquent',
            'model'  => App\User::class,
            'table'  => 'users'
        ],
        'admin' => [
            'driver' => 'eloquent',
            'model'  => App\Mentor::class,
            'table'  => 'mentors'
        ]
    ],

    'password' => [
        'email'  => 'emails.password',
        'table'  => 'password_resets',
        'expire' => 60,
    ],

];

And our controller

<?php

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use Sarav\Multiauth\Foundation\ResetsPasswords;

class PasswordController extends Controller
{

    use ResetsPasswords;

    protected $subject;
    protected $redirectPath = '/dashboard';

    public function __construct()
    {
        $this->subject = trans('passwords.subject');
        $this->user = "user";
    }
}