当前位置:网站首页>Lavel document reading notes -how to use @auth and @guest directives in lavel
Lavel document reading notes -how to use @auth and @guest directives in lavel
2022-07-04 09:51:00 【IT1995】
Laravel Document reading notes -How to use @auth and @guest directives in Laravel
This is what I'm reading Laravel8 Encountered in the document in . Read here @auth and @guest Usage of .
The following is illustrated @auth and @guest stay Laravel The use of .
These two keywords actually replace @if、@endif Of .
Use the following @if、@endif
@if(auth()->user())
// The user is authenticated.
@endifWhen the user has permission , It's just blade It shows that .
Use @auth and @guest It can be simplified into this :
@auth
// The user is authenticated.
@endauthand
@guest
// The user is not authenticated.
@endguestIn personal projects , This is how I use it
<nav class="navbar navbar-dark bg-dark" style="z-index:999">
<div class="container-fluid">
<a class="navbar-brand" href="/">it1995.cn</a>
<ul class="navbar-nav justify-content-end">
@guest
<li class="nav-item">
<a class="nav-link text-white" href="{
{route('login')}}"> Sign in </a>
</li>
@else
<li class="nav-item">
<div class="row">
<div class="col">
<a class="nav-link text-white" href="{
{route('dashboard')}}"> management </a>
</div>
<div class="col">
<a class="nav-link text-white" href="{
{route('signOut')}}"> sign out </a>
</div>
</div>
</li>
@endguest
</ul>
</div>
</nav>
边栏推荐
- A little feeling
- H5 audio tag custom style modification and adding playback control events
- Are there any principal guaranteed financial products in 2022?
- System. Currenttimemillis() and system Nanotime (), which is faster? Don't use it wrong!
- Regular expression (I)
- Advanced technology management - how to design and follow up the performance of students at different levels
- Exercise 7-4 find out the elements that are not common to two arrays (20 points)
- On Multus CNI
- Kotlin 集合操作汇总
- Hands on deep learning (39) -- gating cycle unit Gru
猜你喜欢

MATLAB小技巧(25)竞争神经网络与SOM神经网络

2022-2028 global small batch batch batch furnace industry research and trend analysis report

智能网关助力提高工业数据采集和利用

Hands on deep learning (35) -- text preprocessing (NLP)

Hands on deep learning (43) -- machine translation and its data construction

How web pages interact with applets

Write a mobile date selector component by yourself

2022-2028 global industrial gasket plate heat exchanger industry research and trend analysis report
Web端自动化测试失败原因汇总

Normal vector point cloud rotation
随机推荐
SQL replying to comments
Upgrading Xcode 12 caused Carthage to build cartfile containing only rxswift to fail
品牌连锁店5G/4G无线组网方案
xxl-job惊艳的设计,怎能叫人不爱
mmclassification 标注文件生成
Log cannot be recorded after log4net is deployed to the server
Hands on deep learning (39) -- gating cycle unit Gru
What are the advantages of automation?
Fatal error in golang: concurrent map writes
PHP personal album management system source code, realizes album classification and album grouping, as well as album image management. The database adopts Mysql to realize the login and registration f
View CSDN personal resource download details
Write a jison parser (7/10) from scratch: the iterative development process of the parser generator 'parser generator'
Custom type: structure, enumeration, union
Write a jison parser from scratch (1/10):jison, not JSON
Explanation of closures in golang
A little feeling
Nuxt reports an error: render function or template not defined in component: anonymous
Write a mobile date selector component by yourself
Pueue data migration from '0.4.0' to '0.5.0' versions
Solution to null JSON after serialization in golang