mercredi 31 août 2016

laravel 5.2 Authentication Failure

    Hello Guys i am new to laravel. When the new user register with authentication i am this error message. How to resolve my problem
    The Authentication Failure with this error message. Illuminate\Auth\SessionGuard::login() must be an instance of Illuminate\Contracts\Auth\Authenticatable, instance of App\customer given.

        My controller is

          public function store(Request $request)
    {
        $user = new customer;
        $user->name=Input::get('name');
        $user->email=Input::get('email');
        $user->password=Input::get('password');
        $user->save();

        Auth::login($user);
        return redirect::home();
    }

        and my routes 
        Route::get('register', 'testing@index');
        Route::post('store', 'testing@store');
        Route::get('login', 'testing@create');
        Route::post('logout', 'testing@destroy');

and my register page is 

<form action="store" method="post">
        <label for="name">Name</label>
        <input type="text" name="name" autocomplete="off">
        <br>
        <label for="email">Email</label>
        <input type="text" name="email" autocomplete="off">
        <br>
        <label for="password">Password</label>
        <input type="text" name="password" autocomplete="off">
        <br>
        <input type="hidden" name="_token" value="">
        <br>
        <input type="submit" name="submit" value="Submit">
    </form>

Please help me guys how to register,login and logout with complete authentation. Please help me guys how to register,login and logout with complete authentation. Please help me guys how to register,login and logout with complete authentation. Please help me guys how to register,login and logout with complete authentation. Thanks you and welcome your suggestions.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire