当前位置:网站首页>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>
边栏推荐
- 百度研发三面惨遭滑铁卢:面试官一套组合拳让我当场懵逼
- Leetcode (Sword finger offer) - 35 Replication of complex linked list
- [on February 11, 2022, the latest and most fully available script library collection of the whole network, a total of 23]
- Hands on deep learning (32) -- fully connected convolutional neural network FCN
- Kotlin set operation summary
- How do microservices aggregate API documents? This wave of show~
- libmysqlclient.so.20: cannot open shared object file: No such file or directory
- Exercise 7-8 converting strings to decimal integers (15 points)
- Hands on deep learning (38) -- realize RNN from scratch
- Mmclassification annotation file generation
猜你喜欢

xxl-job惊艳的设计,怎能叫人不爱

How web pages interact with applets

Devop basic command

Custom type: structure, enumeration, union

libmysqlclient.so.20: cannot open shared object file: No such file or directory

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

C # use gdi+ to add text to the picture and make the text adaptive to the rectangular area

Hands on deep learning (37) -- cyclic neural network

C语言指针经典面试题——第一弹

How can people not love the amazing design of XXL job
随机推荐
Solution to null JSON after serialization in golang
SQL replying to comments
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
Kotlin:集合使用
Regular expression (I)
Luogu deep foundation part 1 Introduction to language Chapter 4 loop structure programming (2022.02.14)
Pcl:: fromrosmsg alarm failed to find match for field 'intensity'
Get the source code in the mask with the help of shims
Vanishing numbers
Baidu R & D suffered Waterloo on three sides: I was stunned by the interviewer's set of combination punches on the spot
7-17 crawling worms (15 points)
Machine learning -- neural network (IV): BP neural network
In the case of easyUI DataGrid paging, click the small triangle icon in the header to reorder all the data in the database
2022-2028 global protein confectionery industry research and trend analysis report
Hands on deep learning (33) -- style transfer
El Table Radio select and hide the select all box
Hands on deep learning (43) -- machine translation and its data construction
Web端自动化测试失败原因汇总
Go context 基本介绍
智慧路灯杆水库区安全监测应用