如何在Laravel 5.2中使用auth后重定向到不同的页面

The problem is the following. I made standard authentication. php artisan make:auth. Now I want to redirect to different pages after login and after registration. There are couple of solutions in web. To use overriding of postLogin and postRegister method, but it doesn't work for me.

class AuthController extends Controller
{
    use AuthenticatesAndRegistersUsers, ThrottlesLogins;

    public function postLogin(Request $request)
    {
        return property_exists($this, 'redirectTo') ? $this->redirectTo : '/main';
    }

    public function postRegister(Request $request)
    {
        return property_exists($this, 'redirectTo') ? $this->redirectTo : '/registrationconfirmation';
    }

Anyway it goes to one and same page after registration and login. Will very appreciate any answers.

try to change

/app/Http/Controllers/Auth/AuthController.php :

You have to override it in your controller. Check the current one in the auth trait

protected $redirectTo = '/your_page';