Home  >  Article  >  Backend Development  >  With the laravel framework, you can enter the homepage without logging in. How to set up routing?

With the laravel framework, you can enter the homepage without logging in. How to set up routing?

WBOY
WBOYOriginal
2016-12-01 00:25:432146browse

Laravel framework, you can enter the homepage without logging in. How to set up routing?

Reply content:

Laravel framework, you can enter the homepage without logging in. How to set up routing?

Just don’t put it in auth middleware.

Route::any('/', 'HomeController@index ');

You can use except in the controller, the key depends on how you write the middleware

<code>public function __construct() {
        $this->middleware('auth', ['except' => [
            //排除的路由
        ]]);
}</code>
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