Changelog

Admin-authored release notes with a category and a publish date, sanitised on save, and a published() scope for the public page you add.

The changelog entries list in the admin
/admin/changelog, with a draft entry shown unpublished.

What it adds

FilePurpose
app/Models/ChangelogEntry.phpulid, title, HTML body, category, published_at, is_published; published() scope
database/factories/ChangelogEntryFactory.phpFactory with a draft() state
database/migrations/*_create_changelog_entries_table.php
app/Livewire/Admin/Changelog/ChangelogList.php, ChangelogForm.php and viewsList, create and edit

Install

php artisan ui-kit:install-module changelog

Composer: mews/purifier:^3.4, which sanitises the HTML body on save.

What the installer changes

  • Publishes the purifier config.
  • Adds three routes between the markers in routes/admin.php and a Changelog nav entry in config/admin.php.
  • Runs the migration.

Routes

RouteName
GET /admin/changelogadmin.changelog.index
GET /admin/changelog/createadmin.changelog.create
GET /admin/changelog/{ulid}/editadmin.changelog.edit
The changelog entry form
Create and edit share one form component.

A public feed

The module ships only the admin side. For a public page, add a route over the scope and supply the view:

// routes/web.php
Route::get('changelog', fn () => view('changelog.public', [
    'entries' => \App\Models\ChangelogEntry::published()->orderBy('published_at', 'desc')->get(),
]))->name('changelog.public');

published() filters on is_published and a published_at in the past, so a scheduled entry appears on its date.

Removing

Delete the model, factory, Livewire components and views, remove the three route lines and the nav entry between their markers, drop changelog_entries, remove changelog from installed_modules, and composer remove mews/purifier if nothing else uses it.

Was this page helpful?