mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-01 01:36:00 -04:00
9079700170
- Renamed to "ActivityLogger" to be more focused in usage. - Extracted out query elements to seperate "ActivityQueries" class. - Removed old 'addForEntity' activity method to limit activity record points.
29 lines
768 B
PHP
29 lines
768 B
PHP
<?php
|
|
|
|
namespace BookStack\Http\Controllers;
|
|
|
|
use BookStack\Actions\ActivityQueries;
|
|
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 = $repo->getRecentlyCreated($user, 5);
|
|
$assetCounts = $repo->getAssetCounts($user);
|
|
|
|
return view('users.profile', [
|
|
'user' => $user,
|
|
'activity' => $userActivity,
|
|
'recentlyCreated' => $recentlyCreated,
|
|
'assetCounts' => $assetCounts,
|
|
]);
|
|
}
|
|
}
|