📖 2 minutes read
Database comment fields are often filled with plain reference IDs that require manual copying and pasting into search bars or URLs. Here’s a tiny UX improvement that turns those plain IDs into clickable links.
The Problem
Your admin panel lets users add notes to records. Users often reference related resources by ID:
// Admin adds comment like this:
"Related to order #12345"
"See invoice #67890 for details"
Later, someone reads that comment and has to manually navigate to the orders page, search for 12345, etc. Wasted clicks.
The Solution: Markdown Links
Store markdown-formatted links in your comment field instead:
// When saving the comment:
$comment = sprintf(
'[Order #%d](%s)',
$order->id,
route('admin.orders.show', $order)
);
$record->notes = $comment;
$record->save();
Result in the database:
[Order #12345](/admin/orders/12345)
Display It in the UI
Most admin panels render comments as plain text. Parse it with a markdown library on display:
use League\CommonMark\CommonMarkConverter;
$converter = new CommonMarkConverter();
$html = $converter->convert($record->notes);
// In your Blade template:
{!! $html !!}
Now your admins see clickable links instead of plain IDs.
When To Use This
- Audit logs: Link to the user who made the change
- Error reports: Link to the transaction or session that failed
- Notes fields: Link to related records
- Status changes: Link to the approval or rejection action
Quick Wins
- Start with one high-traffic admin page
- Add markdown rendering to the comments display
- Wrap IDs in markdown links when creating new comments
- Watch your team stop asking “where do I find order 12345?”
Small change. Big quality of life improvement.
Leave a Reply