D
D
Danbka2016-10-26 22:47:33
Laravel
Danbka, 2016-10-26 22:47:33

How to make a redirect to the current page after authorization?

I am using Laravel 5.3.
In the /app/Http/Controllers/Auth/LoginController.php file, you can specify the page that the user will be taken to after authorization:
protected $redirectTo = '/home';
How to make the user stay on the current page?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DevMan, 2016-10-26
@Danbka

stackoverflow.com/questions/29954791/laravel-5-aft...
stackoverflow.com/questions/15389833/laravel-redir...
https://laracasts.com/discuss/channels/laravel/red...

M
Mikhail Osher, 2016-10-27
@miraage

return redirect($request->headers->get('referer', '/'));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question