To show the banner for non-logged in users, you can check if the member_profile object exists before displaying the welcome message. Here's an example:
<div class="banner_section">
<img
class="banner_image"
src="https://s3.ap-south-1.amazonaws.com/member-dev.tghclinic.com/website+stock+images/Stock+Photos/service_mian_image.jpeg"
alt=""
/>
<div class="banner_data_services">
@if (isset($member_profile))
<span class="banner-text mb-2" style="text-transform: capitalize;">
Welcome {{ $member_profile->first_name }} {{ $member_profile->last_name }}
</span>
@endif
<br />
<span class="banner-heading">Start your health transformation here</span>
</div>
<div class="banner_content"></div>
</div>
In this example, we're using an @if statement to check if the $member_profile object exists. If it does, we display the welcome message with the user's first and last name. If it doesn't, we skip that part and only display the heading.
Note that this assumes that the $member_profile object is passed to the view from the controller. If it's not, you'll need to modify the code accordingly.