@extends('layouts.app') @section('title', $user->name . '\'s Profile') @section('content')
{{-- Profile Card --}}
{{ $user->name }}

{{ $user->name }}

@if(auth()->check() && auth()->id() === $user->id)

{{ $user->email }}

@endif

{{ $user->bio ?? 'This user has not added a bio yet.' }}

{{-- Posts --}}
Posts by {{ $user->name }}
@forelse($posts as $post)
{{-- Post Title (TEXT ONLY) --}}
{{ $post->title }}

{{ $post->created_at->format('M d, Y') }}

{{ \Illuminate\Support\Str::limit(strip_tags($post->body), 180) }}

{{-- View Post Button --}} View Post
@empty

No posts yet.

@endforelse
{{ $posts->links() }}
@endsection