php - 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
解决方案
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
推荐阅读
- terraform - 多个模块的公共变量
- node.js - 无法使用 mongodb 中的节点删除项目
- android - Android Kotlin - retrofit2 获取 JSONArray 而不是模型列表
- postgresql - 连接到在 Docker 中运行的 postgres 时出错:pq: password authentication failed for user "postgres"
- arangodb - 按字段合并文档
- ssl - SSL 证书错误如何仅针对非 www 域显示?
- java - java.lang.IllegalAccessError:从 vertx 访问 GraphQL API 时
- sql - 如何在sql中创建图表以按期间获取客户的帐户数
- python - 如何在 Python 中将输入函数与烧瓶一起使用,以捕获用户输入,然后根据该响应发送响应。像对话流
- python - 使用 Python API 从另一个网络连接到盈透证券交易平台