On the edit profile page for a user, I want to show the existing values of the current logged-in user details like name, email, gender etc. My questions are as follows
- Is it recommendable to user Auth::user()->name , Auth::user()->email directly to populate the form fields ? Or shall I create a variable like
$user = Auth::user();in my controller and pass it on to my view to $user like a regular object? -
Does using Auth::user(), multiple times on a given view file hit my database each time I use it?
Thanks in advance.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire