Laravel @guest Directive
We use this directive to show something by detecting that the user is not logged in. Normally we show content by checking with @if directive like this.
@if(auth()->guest())
// user login.
@endif
But Blade gives us a directive called @guest. That's exactly what works and you're writing cleaner code.
@guest
// user login.
@endguest
There is also a usage that we can say show this if she is not logged in like this, and show that if she is logged in
@guest
// user login.
@else
// user not login.
@endguest
Comments
Popular Articles
Popular Tags
- #directive
- #Function
- #React
- #Class
- #centOS
- #Json
- #Text
- #API
- #URL
- #Encrypting
- #Redirect
- #Form
- #Special Characters
- #Special
- #Random
- #Generating
- #SASS
- #Version
- #Installation
- #Show
- #
- #Ajax
- #method
- #Logic For Displaying Posts
- #Key
- #DDOS
- #Default Value
- #Comment Line
- #1364 Field
- #Error
- #Abbreviation
- #QR Code Generating
- #Date
- #timeAgo
- #cURL
- #Array
- #Arrays with Key Values to String Statement
- #Short Tag
- #Vite
- #Reading Excel Files
- #Activate
- #Reading
- #Composer
- #Autoloader
- #PSR-4
- #Insert
- #Record
- #Real Time
- #Characters
- #Socket.io
There are no comments, make the firs comment