2021-06-26 11:23:15 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace BookStack\Http\Controllers;
|
2021-03-09 18:06:12 -05:00
|
|
|
|
|
|
|
use BookStack\Auth\UserRepo;
|
|
|
|
|
|
|
|
class UserProfileController extends Controller
|
|
|
|
{
|
|
|
|
/**
|
2021-06-26 11:23:15 -04:00
|
|
|
* Show the user profile page.
|
2021-03-09 18:06:12 -05:00
|
|
|
*/
|
|
|
|
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 11:23:15 -04:00
|
|
|
'user' => $user,
|
|
|
|
'activity' => $userActivity,
|
2021-03-09 18:06:12 -05:00
|
|
|
'recentlyCreated' => $recentlyCreated,
|
2021-06-26 11:23:15 -04:00
|
|
|
'assetCounts' => $assetCounts,
|
2021-03-09 18:06:12 -05:00
|
|
|
]);
|
|
|
|
}
|
|
|
|
}
|