@extends('layout.app') @section('content')
img

{{$user->name ?? ''}}

{{$user->title ?? ''}}

status
@php $authId = auth()->id(); // Find any friendship row between auth and this $user $friendship = \App\Models\FriendShip::where(function ($query) use ($authId, $user) { $query->where(function ($q) use ($authId, $user) { $q->where('sender_id', $authId) ->where('receiver_id', $user->id); })->orWhere(function ($q) use ($authId, $user) { $q->where('sender_id', $user->id) ->where('receiver_id', $authId); }); })->first(); @endphp
@if($friendship) {{-- 1) PENDING --}} @if($friendship->status === 'pending') @if($friendship->sender_id === $authId) {{-- Auth has sent to $user --}} Request Sent @else {{-- Auth is the receiver; show Accept / Pass --}}
  • @csrf
  • @csrf
@endif {{-- 2) ACCEPTED --}} @elseif($friendship->status === 'accepted') Followed {{-- 3) DECLINED or CANCELED --}} @elseif(in_array($friendship->status, ['declined','canceled'])) Passed {{-- 4) Safety fallback --}} @else Unknown @endif {{-- 5) NO friendship row at all: show Follow button --}} @else Follow @endif
{{--
--}} {{--
--}} {{--

People Viewed Profile

--}} {{-- --}} {{--
--}} {{--
    --}} {{-- @forelse ($viewers as $view)--}} {{--
  • --}} {{--
    --}} {{--
    --}} {{-- img--}} {{--
    --}} {{--
    --}} {{--

    {{$view->viewer->name ?? ''}}

    --}} {{-- {{$view->viewer->title ?? ''}}--}} {{--
    --}} {{--
    --}} {{-- --}} {{--
  • --}} {{-- @empty--}} {{--
  • No one has viewed this profile yet.
  • --}} {{-- @endforelse--}} {{--
--}} {{-- View More--}} {{--
--}}
@if($user->chat->isEmpty()) @else @foreach($user->chat as $chat) @php $chat->userHasLiked = $chat->likes()->where('user_id', auth()->id())->exists(); @endphp
img

{{$chat->user->name ?? ''}}

{{$chat->created_at->diffForHumans()}}

{{$chat->title ?? ''}}

{{$chat->sub_title ?? ''}}
@php $words = explode(' ', $chat->description); $shortDescription = implode(' ', array_slice($words, 0, 50)); $fullDescription = implode(' ', array_slice($words, 50)); @endphp

{!! $shortDescription !!} @if (count($words) > 50) {!! $fullDescription !!} View More @endif

@endforeach @endif

Portfolio

    @if($user->getMedia('portfolio')->isEmpty()) No Portfolio Update @else @foreach($user->getMedia('portfolio') as $media)
  • @endforeach @endif
@endsection @push('script') @endpush