mortezamasumi/fb-message

Internal messaging and mailbox toolkit for Filament v5 — inbox, sent, archived and trash folders with reply and forward support.

Maintainers

Package info

github.com/mortezamasumi/fb-message

pkg:composer/mortezamasumi/fb-message

Transparency log

Statistics

Installs: 193

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v5.1.0 2026-08-01 13:20 UTC

README

Latest Version on Packagist GitHub Tests Action Status Total Downloads License

An internal messaging and mailbox toolkit for Filament v5. Users can send messages with attachments, manage them across inbox, sent, archived, and trash folders, reply to and forward received messages, and get notified in the panel when a new message arrives.

Features

  • Folders — inbox, sent, archived, and trash tabs with per-user counts
  • Reply & forward — respond to or forward a message with the original recipients pre-filled
  • Read tracking — unread badge on the inbox tab and the navigation item
  • Attachments — multiple PDF, image, audio, and video files with configurable disk, size, and count limits
  • Database notifications — recipients are notified in the panel with a link to the message
  • Filament Shield integrationview, create, reply, forward, archive, trash, and delete permissions
  • Localized — English and Persian (Farsi) translations, Jalali date display via fb-essentials

Installation

composer require mortezamasumi/fb-message

Publish and run the migrations:

php artisan vendor:publish --tag="fb-message-migrations"
php artisan migrate

Publish the config file:

php artisan vendor:publish --tag="fb-message-config"

Configuration

// config/fb-message.php
return [
    'navigation' => [
        'model_label' => 'fb-message::fb-message.navigation.label',
        'plural_model_label' => 'fb-message::fb-message.navigation.plural_label',
        'group' => null,
        'parent_item' => null,
        'icon' => 'heroicon-o-envelope',
        'active_icon' => 'heroicon-s-envelope',
        'badge' => false,
        'badge_tooltip' => null,
        'sort' => 9999,
    ],
    'max_attachments' => env('MESSAGE_MAX_ATTACHMENTS', 5),
    'max_attachment_size' => env('MESSAGE_MAX_ATTACHMENT_SIZE', 8000),
    'attachment_disk' => env('MESSAGE_ATTACHMENT_DISK', 'public'),
    'attachment_folder' => env('MESSAGE_ATTACHMENT_FOLDER', '/uploads/attachments'),
    'attachment_visibility' => env('MESSAGE_ATTACHMENT_VISIBILITY', 'public'),
];

Usage

Register the plugin in a panel

use Mortezamasumi\FbMessage\FbMessagePlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugin(FbMessagePlugin::make());
}

Recipient scope

Your user model should define a messageTo scope to control which users can be selected as recipients. Return $query to allow all users:

use Illuminate\Database\Eloquent\Builder;

public function scopeMessageTo(Builder $query): Builder
{
    return $query;
}

Managing messages programmatically

use Mortezamasumi\FbMessage\Facades\FbMessage;

FbMessage::markAsRead($message);   // mark as read for the current user
FbMessage::archive($message);      // move to the archived folder
FbMessage::unarchive($message);    // restore to inbox / sent
FbMessage::trash($message);        // move to the trash folder
FbMessage::restore($message);      // restore from trash
FbMessage::forget($message);       // detach the current user and delete when nobody references it

Support policy

PHP Laravel Filament
8.3 12 5.x

Testing

composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover a security vulnerability, please review our security policy on how to report it.

Changelog

Please see CHANGELOG for recent changes.

License

The MIT License (MIT). See LICENSE.md for details.