Laravel - Routing

In Laravel, the route is the starting point of the project.

The following summarizes some of the common problems in routing.

 

A route 404

Because the configuration file does not open redirect module, it can be solved by following the operation.

.. 1, PHP INI openssl open module;

 2, the httpd. The conf rewrite_module open module;
3 , provided the AllowOverride
<Directory "C: / Apache24 / the htdocs"> the Options the Indexes FollowSymLinks the AllowOverride All the Require All granted </ Directory> . 4, restart the server

 

Second, the development of micro-channel routing

POST requests are required in Laravel CSRF data, but does not take over the micro-channel. It allows csrf exclude these routes.

In App / Http / Middleware / VerifyCsrfToken. PHP file, add the route to be excluded. 

protected  $ the except = [
 '/ WeChat', 
];

 

Guess you like

Origin www.cnblogs.com/rendd/p/11617413.html