I have developed a package for Laravel in which I'm trying to fetch the logged in user name but it is giving error. package is currently in the vendor folder
error
ErrorException (E_ERROR)
Trying to get property 'name' of non-object
How I can get current logged in user name?