lots of design improvements

This commit is contained in:
Doar Mihai
2026-02-14 16:11:09 +02:00
parent 56b593d9ca
commit 67de095a03
25 changed files with 1942 additions and 1477 deletions
+16 -1
View File
@@ -15,7 +15,22 @@ class ProfileController extends Controller
*/
public function show(User $user)
{
return view('profile.show', compact('user'));
// Get user's products
$products = $user->products()
->with(['category', 'user'])
->approved()
->withCount('upvotes')
->latest()
->paginate(12);
// Get user's stats
$stats = [
'products_count' => $user->products()->approved()->count(),
'total_upvotes' => $user->products()->approved()->withCount('upvotes')->get()->sum('upvotes_count'),
'comments_count' => $user->comments()->count(),
];
return view('profile.show', compact('user', 'products', 'stats'));
}
/**