Skip to content

Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.

815 B
Raw Blame
<?php

declare(strict_types=1);

namespace App\Actions\Changelog;

use App\Models\ChangelogEntry;
use App\Models\User;
use Illuminate\Pagination\LengthAwarePaginator;

class ListChangelogEntries
{
    /**
     * The "What's New" modal loads five entries per page (owner decision
     * 2026-10-14, an exception to `app.pagination.default`).
     */
    public const PAGE_SIZE = 5;

    public const PAGE_NAME = 'changelog_page';

    /**
     * @return LengthAwarePaginator<int, ChangelogEntry>
     */
    public static function execute(User $user): LengthAwarePaginator
    {
        return ChangelogEntry::query()
            ->published()
            ->withSeenBy($user)
            ->withReactionBy($user)
            ->latestFirst()
            ->paginate(self::PAGE_SIZE, pageName: self::PAGE_NAME);
    }
}