Your formatting is messed up but the error it returns is pretty straightforward.
roleName is not available on null. Meaning auth()->user() is returning null.
Since this looks like your trying to access it via an API request which are session-less, you'll have to change how you access the current user via the API. If you look at the app\Http\Kernel.phpfile you'll see that on only the 'web' middleware group there is a StartSessionwhich is what allows you to access auth()->user(). Since your api middleware group doesn't have this, you cannot access the "current session".
There are ways around like Passport, and others, a quick google will help you along :)
Ref: https://github.com/laravel/laravel/blob/8.x/app/Http/Kernel.php