There is a laravel controller where i use code

$user = Auth::user(); 

I invoke the current user $user , and I can get his attributes for example

 $user->name; $user->surname; 

But how to get an array or collection of all attributes of the user $user ?

    1 answer 1

    Auth::user() is already a user object with all its properties. If you want to see them in a more familiar form, then look, for example, so Auth::user()->toArray()