rarq/filament-quick-notes
Filament panel plugin that adds persistent sticky notes to the topbar. Each user can create, edit, color-code, reorder, and manage personal notes without leaving the current page, with staged editing, unsaved-change protection, and multilingual support.
Installation:
composer require rarq/filament-quick-notes
php artisan filament-quick-notes:install
This publishes the config file and migrations.
Register the Plugin:
Add to your PanelProvider:
use Rarq\FilamentQuickNotes\FilamentQuickNotesPlugin;
$panel->plugins([
FilamentQuickNotesPlugin::make(),
]);
Enable on User Model: Add the trait to your user model:
use Rarq\FilamentQuickNotes\Traits\HasFilamentQuickNotes;
class User extends Authenticatable
{
use HasFilamentQuickNotes;
}
Quickly jot down a reminder while working in Filament:
Staged Editing:
Conditional Visibility:
FilamentQuickNotesPlugin::make()
->visible(fn () => auth()->user()->hasRole('admin')),
Positioning:
'position' => \Filament\View\PanelsRenderHook::TOPBAR_START,
GLOBAL_SEARCH_BEFORE (default), GLOBAL_SEARCH_AFTER, TOPBAR_START/END.Multi-Tenancy:
User, TenantUser). Notes are scoped to the authenticated user.Localization: The plugin supports multilingual labels (e.g., "Notes", "Save Changes"). Override via language files or config.
Custom Models:
Extend FilamentQuickNote or implement the same interface to use a custom model:
'quick_notes_model' => App\Models\CustomQuickNote::class,
Deletion Behavior: Choose between soft-deletes (default) or permanent deletion:
'deletion_type' => \Rarq\FilamentQuickNotes\Enums\DeletionType::FORCE,
Styling:
Override the Blade view (resources/views/vendor/filament-quick-notes/...) to match your panel’s theme.
Migration Conflicts:
filament_quick_notes), ensure the HasFilamentQuickNotes trait’s notes() relation matches:
public function notes()
{
return $this->hasMany(\Rarq\FilamentQuickNotes\Models\FilamentQuickNote::class, 'user_id');
}
Unsaved Changes Guard:
shouldPreventPanelClose() method in your custom model.Caching:
Missing Button:
Verify the plugin is registered in PanelProvider and the user model has the HasFilamentQuickNotes trait.
Notes Not Saving:
Check the filament_quick_notes table for records. If using soft deletes, inspect the deleted_at column.
Permission Issues:
Ensure the user model’s notes() relation is accessible (e.g., no visible/appends conflicts).
Custom Actions:
Add buttons to individual notes via the actions config:
'note_actions' => [
'archive' => [
'label' => 'Archive',
'icon' => 'heroicon-o-archive',
'color' => 'gray',
],
],
Note Metadata:
Extend the FilamentQuickNote model to store additional fields (e.g., priority, due_date):
class CustomQuickNote extends FilamentQuickNote
{
protected $fillable = ['content', 'color', 'priority'];
}
API Access: Expose notes via a custom API endpoint using the same model:
Route::get('/notes', function () {
return auth()->user()->notes()->latest()->get();
});
Keyboard Shortcuts:
Bind a shortcut (e.g., Ctrl+Shift+N) to toggle the notes panel using Filament’s registerScript:
$panel->script(function () {
return <<<JS
document.addEventListener('keydown', (e) => {
if (e.ctrlKey && e.shiftKey && e.key === 'N') {
document.querySelector('[data-testid="quick-notes-toggle"]').click();
}
});
JS;
});
Team Collaboration:
Use the plugin for team-wide notes by storing notes on a shared model (e.g., Team) instead of the user model. Override the relation in the trait:
public function notes()
{
return $this->belongsToMany(Team::class)->withPivot('content', 'color');
}
How can I help you explore Laravel packages today?