当前位置:网站首页>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>
边栏推荐
- Servlet基本原理与常见API方法的应用
- QTreeView+自定义Model实现示例
- Hands on deep learning (33) -- style transfer
- 百度研发三面惨遭滑铁卢:面试官一套组合拳让我当场懵逼
- In the case of easyUI DataGrid paging, click the small triangle icon in the header to reorder all the data in the database
- Golang Modules
- Log cannot be recorded after log4net is deployed to the server
- Intelligent gateway helps improve industrial data acquisition and utilization
- Hands on deep learning (43) -- machine translation and its data construction
- Exercise 7-8 converting strings to decimal integers (15 points)
猜你喜欢

Hands on deep learning (42) -- bi-directional recurrent neural network (BI RNN)

Log cannot be recorded after log4net is deployed to the server

2. Data type

Qtreeview+ custom model implementation example

Custom type: structure, enumeration, union

JDBC and MySQL database

Svg image quoted from CodeChina

How does idea withdraw code from remote push

2022-2028 global seeder industry research and trend analysis report

直方图均衡化
随机推荐
Solution to null JSON after serialization in golang
Golang Modules
Deep learning 500 questions
Write a jison parser from scratch (1/10):jison, not JSON
PHP book borrowing management system, with complete functions, supports user foreground management and background management, and supports the latest version of PHP 7 x. Database mysql
libmysqlclient. so. 20: cannot open shared object file: No such file or directory
Exercise 8-7 string sorting (20 points)
Exercise 8-10 output student grades (20 points)
AUTOSAR从入门到精通100讲(106)-域控制器中的SOA
QTreeView+自定义Model实现示例
View CSDN personal resource download details
Exercise 9-1 time conversion (15 points)
Hands on deep learning (III) -- Torch Operation (sorting out documents in detail)
Explanation of for loop in golang
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
Exercise 9-5 address book sorting (20 points)
A little feeling
PHP is used to add, modify and delete movie information, which is divided into foreground management and background management. Foreground users can browse information and post messages, and backgroun
Write a jison parser (7/10) from scratch: the iterative development process of the parser generator 'parser generator'
How web pages interact with applets