This project demonstrates how to add internal messaging functionality into Filament so users can send messages to each other and see their inboxes/outboxes.
Here are the things that we customized on top of the default Filament.
The main Resouce is called MessagesResource
, but the Model is changed to the Topic
Model.
protected static ?string $model = Topic::class; public static function getEloquentQuery(): Builder{ return Topic::query();}
The has a default sorting by created_at
in descending order.
Navigation and Model labels are changed.
protected static ?string $modelLabel = 'Message'; protected static ?string $navigationLabel = 'Inbox';
The messages table has three tabs for all messages, inbox, where the user sees new topics he received, and outbox, where the user sees topics he sent. The tabs are defined in the ListMessages
class in the getTabs()
method. Tabs have a count of how many...