Laravel have some problems with login

Source: Internet
Author: User
Laravel in the login verification, if you write, personal understanding:

Filter to get the user login entry, and then to match in the database, the successful jump to the post-login page, and save the user ID to the session, and then in some places directly call to judge can it?

There is the framework of the Csrf_token if you want to write a login, how to integrate it?

Reply content:

Laravel in the login verification, if you write, personal understanding:

Filter to get the user login entry, and then to match in the database, the successful jump to the post-login page, and save the user ID to the session, and then in some places directly call to judge can it?

There is the framework of the Csrf_token if you want to write a login, how to integrate it?


Just answer your question. 1
In fact, your problem, Laravel auth middleware has been completely to help you achieve, you in some places to judge this problem can be understood as
Some of your pages need to verify that you are logged in, then add this auth middleware to your routing to implement some of your page judgments. Routing
As follows:

Route::group ([' namespace ' = ' Admin ', ' middleware ' = ' auth '], function () {    route::controllers ([        ' Repo ' = ' Repocontroller '    ]);

This way your URL is accessed as follows
Http://yourdomain.com/repo/index will go auth this middleware before you get to your controller action.

The above is laravel on the login has some problems, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.