mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-11-25 17:57:28 +08:00
33 lines
935 B
PHP
33 lines
935 B
PHP
<?php
|
|
|
|
namespace BookStack\Http\Controllers;
|
|
|
|
use BookStack\Actions\ActivityQueries;
|
|
use BookStack\Auth\Queries\UserContentCounts;
|
|
use BookStack\Auth\Queries\UserRecentlyCreatedContent;
|
|
use BookStack\Auth\UserRepo;
|
|
|
|
class UserProfileController extends Controller
|
|
{
|
|
/**
|
|
* Show the user profile page.
|
|
*/
|
|
public function show(UserRepo $repo, ActivityQueries $activities, string $slug)
|
|
{
|
|
$user = $repo->getBySlug($slug);
|
|
|
|
$userActivity = $activities->userActivity($user);
|
|
$recentlyCreated = (new UserRecentlyCreatedContent())->run($user, 5);
|
|
$assetCounts = (new UserContentCounts())->run($user);
|
|
|
|
$this->setPageTitle($user->name);
|
|
|
|
return view('users.profile', [
|
|
'user' => $user,
|
|
'activity' => $userActivity,
|
|
'recentlyCreated' => $recentlyCreated,
|
|
'assetCounts' => $assetCounts,
|
|
]);
|
|
}
|
|
}
|