Administer Users

0

I have a question, I am doing a user administration module in Laravel, I have enabled the routes with:

  

php artisan make: auth

However, I do not want to use the default driver, if not a separate one. I have successfully inserted the data, but I realize that it does not allow me to log in if I create the user with another controller and if I create it with the driver that brings it by default.

What is the problem, someone explain to me what the problem is and how can I solve it?

    
asked by Juan Antonio 12.08.2018 в 02:41
source

2 answers

1

To the new model that you are going to use to administer the users you must incorporate the following

use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;

and in the model statement you would put the following:

class NUEVO_MODELO extends Authenticatable
{
    use Notifiable, ShinobiTrait;

Doing a extends to Authenticatable are saying that this new model is the one that will request the security methods of your system.

If you want to add something so that the administration of permissions is easier to use I recommend shinobi , it is very easy to install and use:

SHINOBI

    
answered by 13.08.2018 в 20:25
1

It can be due to several things:

1.- You are using the routes that come by default and these are pointing to other methods that are not yours.

2.- If the authentication you are doing is not similar to the one that comes by default in laravel, it does not create the session instances created by laravel and therefore it does not register you as authenticated.

In other words when you acknowledge your user you must execute

$ this- > guard () - > user ();

Which creates credentials for authentication.

3.- If you use a different password encryption, it can give you a conflict when using the laravel login system. Since the passwords will never match.

    
answered by 19.08.2018 в 11:12