BookStack/app/Http/Controllers/UserProfileController.php

28 lines
693 B
PHP
Raw Normal View History

2021-06-26 23:23:15 +08:00
<?php
namespace BookStack\Http\Controllers;
use BookStack\Auth\UserRepo;
class UserProfileController extends Controller
{
/**
2021-06-26 23:23:15 +08:00
* Show the user profile page.
*/
public function show(UserRepo $repo, string $slug)
{
$user = $repo->getBySlug($slug);
$userActivity = $repo->getActivity($user);
$recentlyCreated = $repo->getRecentlyCreated($user, 5);
$assetCounts = $repo->getAssetCounts($user);
return view('users.profile', [
2021-06-26 23:23:15 +08:00
'user' => $user,
'activity' => $userActivity,
'recentlyCreated' => $recentlyCreated,
2021-06-26 23:23:15 +08:00
'assetCounts' => $assetCounts,
]);
}
}