BookStack/app/Http/Controllers/UserProfileController.php

29 lines
768 B
PHP
Raw Normal View History

2021-06-26 11:23:15 -04:00
<?php
namespace BookStack\Http\Controllers;
use BookStack\Actions\ActivityQueries;
use BookStack\Auth\UserRepo;
class UserProfileController extends Controller
{
/**
2021-06-26 11:23:15 -04:00
* 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', [
2021-06-26 11:23:15 -04:00
'user' => $user,
'activity' => $userActivity,
'recentlyCreated' => $recentlyCreated,
2021-06-26 11:23:15 -04:00
'assetCounts' => $assetCounts,
]);
}
}