I am new to Laravel. I have a question in my mind... is it correct to use auth::guard to display all user information. Am I using Laravel Breeze authentication?
For example. Is that so-
name: Auth::guard('web')->user()->name mobile: Auth::guard('web')->user()->mobile address: Auth::guard('web')->user()->address city: Auth::guard('web')->user()->city gender: Auth::guard('web')->user()->gender
Like this?
This can work, but it's more common to write it like this. If you're sure your user is logged in, you can skip any extra checks for $user.
If your user may not be logged in, you can add a row-specific check like this:
If your users may not be logged in and you want to make sure they are always logged in, you can do the following: