Download the PHP package ka4ivan/laravel-notification-channel-instagram without Composer
On this page you can find all versions of the php package ka4ivan/laravel-notification-channel-instagram. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ka4ivan/laravel-notification-channel-instagram
More information about ka4ivan/laravel-notification-channel-instagram
Files in ka4ivan/laravel-notification-channel-instagram
Package laravel-notification-channel-instagram
Short Description Instagram Notifications Channel for Laravel
License MIT
Informations about the package laravel-notification-channel-instagram
Instagram Notifications Channel for Laravel
This package makes it easy to send notifications using the Instagram Messenger with Laravel.
Contents
- Installation
- Setting up your Instagram Bot
- Get Profile ID
- Set config
- Set start buttons
- Setting up your Instagram Bot
- Usage
- Available Message methods
- Available Button methods
- Contributing
- License
Installation
You can install the package via composer:
Setting up your Instagram Bot
Get Profile ID
Set config
Next we need to add tokens to our Laravel configurations. Create a new Instagram section inside config/services.php
and place the page token there:
Set start buttons
Run the command to set the start buttons
Possible options for the command
This command will add the start buttons that appear when entering the chat for the first time
Usage
You can now use the Instagram channel in your via()
method, inside the InvoicePaid class. The to($recipientId)
(IGSID) method defines the Instagram user, you want to send the notification to.
The notification will be sent from your Instagram page, whose page token you have configured earlier. Here's a screenshot preview of the notification inside the chat window.
Message Examples
Basic Text Message
Message With Attachment
Media types and specifications
Media Type | Supported Format | Supported Size Maximum |
---|---|---|
Audio | aac, m4a, wav, mp4 | 25MB |
Image | png, jpeg, gif | 8MB |
Video | mp4, ogg, avi, mov, webm | 25MB |
Message With Buttons
Routing a message
You can either send the notification by providing with the page-scoped user id of the recipient to the to($recipientId)
(IGSID) method like shown in the above example or add a routeNotificationForInstagram()
method in your notifiable model:
Available Message methods
to($recipientId)
: (string) User (recipient) Instagram ID (IGSID).text('')
: (string) Notification message.attach($attachmentType, $url)
: (AttachmentType, string) An attachment type (IMAGE, AUDIO, VIDEO) and the url of this attachment.buttons($buttons = [])
: (array) An array of "Call to Action" buttons (Created using NotificationChannels\Instagram\Components\Button::create()). You can add up to 3 buttons of one of the following types: web_url or postback. See Button methods below for more details.
Available Button methods
title('')
: (string) Button Title.data('')
: (string) Button Data - It can be a web url or postback data.type('')
: (string) Button Type -web_url
orpostback
. UseButtonType
enumerator for guaranteeing valid valuesisTypeWebUrl()
: Helper method to create aweb_url
type button.isTypePostback()
: Helper method to create apostback
type button.
Contributing
Please see CONTRIBUTING for details.
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-notification-channel-instagram with dependencies
illuminate/notifications Version ~9.0 || ~10.0 || ~11.0 || ~12.0
illuminate/support Version ~9.0 || ~10.0 || ~11.0 || ~12.0