I\'m getting the following error \"trying to get a property of a non-object\" when I submit a form to add a user, the error is apparently on the first line: Auth::user()->id
In Laravel 5.6 I use
use Auth; $user_id = Auth::user()->id;
as the other suggestion
Auth::id()
seems to apply to older versions of Laravel 5.x and didn't work for me.