lundi 28 septembre 2020

In Laravel ,After registration app redirects to '/home' even after changing $redirectTo variable to '/

I was following the laravel 5.6 documentation and according to them changing $redirectTo variable inside Register Controllers should redirect user to desired location but I always get redirected to '/home'.

RegisterController

protected $redirectTo = '/home';
protected function create(array $data)
    {
        return User::create([
            'name' => $data['name'],
            'username' => $data['name'],
            'email' => $data['email'],
            'password' => Hash::make($data['password']),
        ]);
    }

web.php

Route::get('/', function () {
    return view('welcome');
});

Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire