vendredi 8 mars 2019

Laravel redirect back to login page with error must be an instance of Auth\Authenticatable

I'm trying to redirect back to the registration page from the RegisterController.php like so:

if($discount->expired != null){
    return redirect()->back()->withInput()->withErrors(['discount' => 'Discount code is not valid']);
}

However, when the redirect happens I get the following error:

Argument 1 passed to Illuminate\Auth\SessionGuard::login() must be an instance of Illuminate\Contracts\Auth\Authenticatable, instance of
Illuminate\Http\RedirectResponse given, called in /application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/RegistersUsers.php on line 35

Any ideas why this is happening? It should just be a simply redirect.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire