Closed ajarti closed 10 years ago
Ok I figured it out ...
You have to comment out the original
//'Illuminate\Auth\AuthServiceProvider',
//'Illuminate\Auth\Reminders\ReminderServiceProvider',
Add the new providers to the 'providers' section.
What got me was that my new custom model Admins did not implement UserInterface & RemindableInterface, nor did it include the three requisite methods from the interfaces like so:
<?php
use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableInterface;
class Admin extends \Eloquent implements UserInterface, RemindableInterface {
protected $table = 'admins';
protected $fillable = [];
protected $softDelete = true;
/**
* Get the unique identifier for the user.
*
* @return mixed
*/
public function getAuthIdentifier()
{
return $this->getKey();
}
/**
* Get the password for the user.
*
* @return string
*/
public function getAuthPassword()
{
return $this->password;
}
/**
* Get the e-mail address where password reminders are sent.
*
* @return string
*/
public function getReminderEmail()
{
return $this->email;
}
}
Might be helpful for some to mention this .. lol .. or they can just read this issue.
Thanks again for a killer tool, just what I needed :)
I do state in the documentation that you must replace the original serviceprovider, in the serviceprovider list, but there seems to be a fair bit of confusion regarding that point.
Hahahah I know ... some of us are a bit more challenged than others .. lol Without having read the Laravel Auth documentation, I would never have known to extend my Multi users with the relevant interfaces. But that's why they say RTFM!
And to make it easier, If you haven't subscribed to Laracasts do it now, they are an invaluable resource, thanks Jeff! https://laracasts.com/tags/security
Hi there,
Firstly thanks for an amazing tool!
My apologies for the newbie question, in your setup you say:
Do you mean add it to the 'providers' section and comment out or delete the 'Illuminate\Auth\AuthServiceProvider' reference, or do you mean update the 'Auth' alias in the 'aliases' with MultiAuth. I have added it and commented out the original Auth Provider, but I am getting:
when running:
with a auth config of:
);
It seems to still be trying to use the original Auth?
Usually one just adds new Service Providers to the 'providers' section.
Thanks in advance.