English
English
Appearance
English
English
Appearance
The MessageAction class is a custom FilamentPHP action designed for sending messages within the Softway ERP system. It allows users to compose messages, attach files, and notify followers via email.
The MessageAction is an extension of FilamentPHP's Action class. It provides a structured form for users to create messages with optional attachments.
getDefaultName(): ?string Returns the default name of the action (message.action).
setResource(string $resource): self Sets the resource associated with this action.
setMessageMailView(?string $mailView): self Defines a custom email view for message notifications.
getMessageMailView(): string Retrieves the currently set email view.
getResource(): string Returns the associated resource name.
The message form consists of the following fields:
| Field Name | Type | Description |
|---|---|---|
| subject | TextInput | Optional subject for the message |
| body | RichEditor | The main content of the message |
| attachments | FileUpload | Multiple file attachments |
| type | Hidden | Default value is comment |
Success and error messages are displayed using Filament’s notification system:
Messages trigger an email notification to all followers of the record. The email includes:
To modify the email view, use:
$messageAction->setMessageMailView('your.custom.view');Attachments are stored in messages-attachments and can be retrieved using:
$message->attachments;