php - Can I access current user data in blade? ← (PHP, Laravel)

I started using Laravel to create a small website, and i would like to access to logged user information. Auth::user()

My problem : i have a lot of views and each time i have to add Auth::user() in each controller i create

is there any way to access to Auth::user() directly from views

because i have a sidebar that contains logged user informations in all my views, i would like

i would like to avoid this way :

return view('dashboard.preference', ['profile' => Auth::user()]);

Answer



Solution:

It's ok Ifound the solution, below :

{{ Auth::user()->name }}

Source