![]() Please forgive the tone of the remainder of this post. I’ve been trying to get this to work for hours. Research best solutions in product & software development is our passion.The documentation really needs some work. About CyberCogĬyberCog is a Social Unity of enthusiasts. Please see License File for more information. Please see CHANGELOG for more information on what has changed recently. If you discover any security related issues, please email instead of using the issue tracker. Please see CHANGELOG for more information what has changed recently. Required 'value' => 'Value 1' // The value of this field, displayed underneath the title value. Default: false 'title' => 'Title 1', //The title of this field. 'short' => false, // Whether this field should be a short field. VideoUrl(): Video file to play, only supports what html video does.įields(): An array of Attachment Field Objects. ![]() ImageUrl(): The image to display, will be “big” and easy to see.ĪudioUrl(): Audio file to play, only supports what html audio does. TitleLinkDownload(): When this is true, a download icon appears and clicking this saves the link to file. TitleLink(): Providing this makes the title clickable, pointing to this link. Title(): Title to display for this attachment, displays under the author. MessageLink(): Only applicable if the ts is provided, as it makes the time clickable to this link.Ĭollapsed(): Causes the image, audio, and video sections to be hiding when collapsed is true.Īuthor($name, $link, $icon): shortcut for author methodsĪuthorLink(): Providing this makes the author name clickable and points to this link.ĪuthorIcon(): Displays a tiny icon to the left of the Author’s name. ThumbnailUrl(): An image that displays to the left of the text, looks better when this is relatively small. ISO8601 Zulu Date or instance of any \DateTime Timestamp(): Displays the time next to the text portion. Text(): The text to display for this attachment, it is different than the message’s text. New RocketChatAttachment(),Ĭolor(): The color you want the order on the left side to be, any value background-css supports. RocketChatAttachment:: create()-> imageUrl( 'test'), > from( 'webhook_token') // optional if set in config There are several ways to add one ore more attachments to a message public function toRocketChat( $notifiable) '□')Īvatar(): This will make the avatar use the provided image url.Īttachment(): This will add an single attachment.Īttachments(): This will add multiple attachments.ĬlearAttachments(): This will remove all attachments. Supports Github flavoured markdown.Īlias(): This will cause the message’s name to appear as the given alias, but your username will still display.Įmoji(): This will make the avatar on this message be an emoji. To(): Specifies the channel id to send the notification to (overridden by routeNotificationForRocketChat if empty).Ĭontent(): Sets a content of the notification message. In order to let your notification know which RocketChat channel you are targeting, add the routeNotificationForRocketChat method to your Notifiable model: public function routeNotificationForRocketChat(): string > to( 'channel_name') // optional if set in config Return RocketChatMessage:: create( 'Test message') Public function toRocketChat( $notifiable): RocketChatMessage Use NotificationChannels\ RocketChat\ RocketChatWebhookChannel Use NotificationChannels\ RocketChat\ RocketChatMessage You can use the channel in your via() method inside the notification: use Illuminate\ Notifications\ Notification Default channel (optional) 'channel' => env( 'ROCKETCHAT_CHANNEL'), Base URL for RocketChat API server () 'url' => env( 'ROCKETCHAT_URL'), In order to send message to RocketChat channels, you need to obtain Webhook.Īdd your RocketChat API server's base url, incoming Webhook Token and optionally the default channel to your config/services.php: // config/services.php. You can install the package via composer: $ composer require laravel-notification-channels/rocket-chat Setting up the RocketChat service ![]() This package makes it easy to send notifications using RocketChat with Laravel 5.6+.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |