@php $user=Auth::user(); if($user->userTypeId==2){ $users=$user->getBusinessDetail->businessName; }else{ $users=$user->getUserDetail->userName; } @endphp

{{$users}}