<?php

namespace App\Http\Controllers;

use App\Models\User;

class SocialProfileController extends Controller
{
    public function show(User $user)
    {
        $me         = auth()->user();
        $friendship = $me->friendshipWith($user);
        $posts      = $user->posts()
            ->with(['author', 'likes', 'comments.author'])
            ->latest()
            ->paginate(10);

        return view('social.profile', compact('user', 'friendship', 'posts'));
    }
}
