I\'m completely new to Laravel, MVC and templating engines in general.
I need to show certain navbar buttons and options if a user is logged in such as: Notifications, L
For laravel 5.7 and above, use @auth and @guest directives.Here is the official documentation here
@auth
// The user is authenticated...
@endauth
@guest
// The user is not authenticated...
@endguest
You may specify the authentication guard that should be checked when using the @auth
and @guest
directives:
@auth('admin')
// The user is authenticated...
@endauth
@guest('admin')
// The user is not authenticated...
@endguest
Otherwise, you can use the @unless directive:
@unless (Auth::check())
You are not signed in.
@endunless