Answer the question
In order to leave comments, you need to log in
Is this approach normal practice for Laravel?
Good day.
The site has a dynamic menu. For example, while the user is not logged in, the "Register" button is visible to him, and after authorization it disappears. Is it good practice to check if the user is logged in right in the view? Or are there ways to implement such manipulations somehow more beautifully?
Answer the question
In order to leave comments, you need to log in
Here is the correct solution. Use Blade.
@unless (Auth::check())
You are not signed in.
@endunless
This is from the documentation:
https://laravel.com/docs/master/blade
Is it good practice to check if the user is logged in right in the view?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question