Home  >  Article  >  Backend Development  >  laravel 51 jumps to the specified address after logging in

laravel 51 jumps to the specified address after logging in

WBOY
WBOYOriginal
2016-07-29 09:13:131853browse

In laravel 5.1, laravel uses its own function to log in. After logging in, it will jump to the home address by default. Basically, this is enough.

It’s just that I want it to jump to another specified address, such as admin.

So what should I do?

It’s very simple:

" app/Http/Controllers/Auth/AuthController.php" this file, add

<span>protected </span><span>$redirectPath </span><span>= </span><span>'admin'</span><span>;</span>

Log in again and it’s successful.

The above introduces laravel 51 to jump to the specified address after logging in, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn