Download the PHP package 101media/bird without Composer
On this page you can find all versions of the php package 101media/bird. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download 101media/bird
More information about 101media/bird
Files in 101media/bird
Package bird
Short Description This package allows you to connect to bird's api using Laravel
License MIT
Homepage https://github.com/101media/bird
Informations about the package bird
Bird.com Laravel Package
Introduction
This package provides seamless integration with the Bird.com API, allowing you to manage contacts and send notifications via SMS.
Installation
You can install the package via composer:
After installing the package, you need to publish the configuration file:
Configuration
After publishing the configuration file, you need to set the following environment variables in your .env
file:
All the configuration keys are available in config/bird.php
Usage
Contact Management
Retrieve Contacts
To retrieve contacts from the API, you can use the get
method of ContactManager
:
You can also retrieve a specific contact by ID:
Additional parameters can be provided to customize the query:
Create or Update Contacts
To create or update a contact, use the createOrUpdate
method:
You can specify the identifier key (default is phonenumber
):
Delete Contacts
To delete a contact, use the delete
method:
Notifications
Sending SMS Notifications
At the moment this package only suppots sending SMS notifications with text
type only. To send SMS notifications, you need to use the SMSChannel
class. This class handles sending SMS notifications via Bird.com.
First, create a notification class that returns an instance of SMSMessage
class:
Finally, notify the notifiable entity:
Exception Handling
The package uses custom exceptions to handle errors:
InvalidParameterException
: Thrown when a parameter is invalid.ConnectionException
: Thrown when there is a connection error with the API.NotAnSmsMessageException
: Thrown when the provided message is not an instance ofSMSMessage
.NotificationNotSent
: Thrown when the notification could not be sent.
Make sure to catch these exceptions in your code to handle errors gracefully.
Contributing
Please submit issues and pull requests to the GitHub repository.
License
This package is open-sourced software licensed under the MIT license.
Contact
For any inquiries or support, please contact 101Media.
This README now includes sections for both SMSChannel
and SMSMessage
, as well as the existing contact management functionality. If you have any more classes or details to add, let me know!
All versions of bird with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0||^11.0