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)!