mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-12-14 07:07:21 +08:00
141eecb858
Also moved home controller and moved controllers up a level in http.
34 lines
971 B
PHP
34 lines
971 B
PHP
<?php
|
|
|
|
namespace BookStack\Users\Controllers;
|
|
|
|
use BookStack\Activity\ActivityQueries;
|
|
use BookStack\Http\Controller;
|
|
use BookStack\Users\Queries\UserContentCounts;
|
|
use BookStack\Users\Queries\UserRecentlyCreatedContent;
|
|
use BookStack\Users\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,
|
|
]);
|
|
}
|
|
}
|