首页 > 解决方案 > Can someone walk me through this laravel code

问题描述

I'm new to laravel..currently learning to use the auth middleware. can someone walk me through the code..with emphasis on this line

 @if (Route::has('register'))
                            <li class="nav-item">
                                <a class="nav-link" href="{{ route('register') }}">{{ __('Register') }}</a>
                            </li>
                        @endif 

the rest of the code under app.blade.php code under layout folder is below enter image description here

标签: phplaravel

解决方案


First Welcome to laravel .. Learning laravel will make you learn a lot of the modern web development techniques as you go through it.

about the code it's a check that determines whether your app's router has a route named register or not ..

by default this route will not be register .. but after you run this command

php artisan make:auth

laravel will register it for you by adding Auth::routes() to routes/web.php


推荐阅读