Implement academy analytics, billing, and web stories updates

This commit is contained in:
2026-05-26 07:27:29 +02:00
parent 456c3d6bb0
commit 0b33a1b074
177 changed files with 27360 additions and 2685 deletions

View File

@@ -10,11 +10,21 @@ use App\Services\ThumbnailPresenter;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Str;
use Carbon\Carbon;
use Illuminate\Contracts\Pagination\Paginator;
class LatestCommentsController extends Controller
{
private const PER_PAGE = 20;
private function paginationMeta(Paginator $paginator): array
{
return [
'current_page' => $paginator->currentPage(),
'per_page' => $paginator->perPage(),
'has_more' => $paginator->hasMorePages(),
];
}
public function index(Request $request)
{
$page_title = 'Latest Comments';
@@ -38,7 +48,8 @@ class LatestCommentsController extends Controller
$q->public()->published()->whereNull('deleted_at');
})
->orderByDesc('artwork_comments.created_at')
->paginate(self::PER_PAGE);
->orderByDesc('artwork_comments.id')
->simplePaginate(self::PER_PAGE);
});
$items = $initialData->getCollection()->map(function (ArtworkComment $c) {
@@ -76,13 +87,7 @@ class LatestCommentsController extends Controller
$props = [
'initialComments' => $items->values()->all(),
'initialMeta' => [
'current_page' => $initialData->currentPage(),
'last_page' => $initialData->lastPage(),
'per_page' => $initialData->perPage(),
'total' => $initialData->total(),
'has_more' => $initialData->hasMorePages(),
],
'initialMeta' => $this->paginationMeta($initialData),
'isAuthenticated' => (bool) auth()->user(),
];