Displays an "Updated X days ago" badge in the post meta row whenever a post has been edited after its original publication date. Helps readers know whether content is fresh without needing to track individual edit timestamps themselves.
Features:
- Badge only appears when the post was updated at least 1 day after publication - prevents false positives on the initial publish
- Relative time label using Laravel Carbon's
diffForHumans()(e.g. "Updated 3 days ago", "Updated 2 months ago") - Amber colour to visually distinguish it from the standard meta items
- No admin configuration, no database queries at render time
- Injects into the
contensio/frontend/post-metahook - renders inline with date and reading time
- Contensio 2.0 or later
composer require contensio/plugin-last-updatedCopy the plugin directory and register the service provider via the admin plugin manager.
No migrations or configuration required.
The plugin hooks into contensio/frontend/post-meta, which receives the Content model and the active ContentTranslation as arguments. It compares published_at and updated_at using Carbon's diffInDays(). If the difference is less than 1 day, no badge is rendered.
When the badge is shown, it outputs an inline <span> with a circular arrow icon and the relative time string:
· ↻ Updated 3 days ago
| Hook | Description |
|---|---|
contensio/frontend/post-meta |
Injects the updated badge into the post meta row |