Notable is a Laravel package that adds polymorphic note functionality to any Eloquent model. It allows you to attach notes/comments to models with creator tracking, timestamps, and powerful query scopes.
This package is helpful for any note-taking features you might need on a model, or for tools like auditing logs and user feedback. It includes powerful query scopes, and you can easily add note support to a model using the HasNotables trait:
class SupportTicket extends Model{ use HasNotables;} // Customer adds note$ticket->addNote('Still experiencing the issue', $customer); // Support agent responds$ticket->addNote('Investigating the problem', $agent); // Get conversation history$conversation = $ticket->getNotesWithCreator(); $ticket->getNotesToday();$ticket->getNotesThisWeek();$ticket->getNotesThisMonth();$ticket->getNotesInRange('2024-01-01', '2024-12-31');$ticket->searchNotes('error');
Main Features
- Polymorphic Relationships - Attach notes to any Eloquent model
- Creator Tracking - Track who created each note (also polymorphic!)
- Timestamps - Automatic created_at and updated_at tracking
- Query Scopes - Powerful query methods for filtering notes
- Configurable - Customize table names through config
- Easy Integration - Simple trait-based implementation
- Laravel 10+ Ready - Built for modern Laravel applications
💻 You can get started with this package on GitHub: EG-Mohamed/Notable.