Download the PHP package shahil/msgraph without Composer
On this page you can find all versions of the php package shahil/msgraph. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download shahil/msgraph
More information about shahil/msgraph
Files in shahil/msgraph
Package msgraph
Short Description A Laravel package for Microsoft Graph API Teams Message integration.
License MIT
Informations about the package msgraph
MS Graph Integration for Laravel
shahil/ms-graph is a Laravel package that simplifies the integration with Microsoft's Graph API, enabling you to send messages, manage chats, send group messages, and utilize Adaptive Cards in your Laravel application effortlessly.
Features
- Fetch and manage OAuth tokens for Microsoft Graph API.
- Retrieve user details using email addresses.
- Create one-on-one or group chats dynamically.
- Send text messages or Adaptive Cards to users or groups via Microsoft Teams.
Installation
Requirements
- PHP 8.0+
- Laravel 8.0+
- A registered Azure AD application with required permissions for Microsoft Graph API.
Steps
-
Install the package via Composer:
-
Publish the configuration file:
- Update the
.env
file with your Azure AD application credentials:
Configuration
The package provides a configuration file (config/msgraph.php
) for customizing default values:
Usage
-
Retrieve User ID by Email
-
Send a Simple Message
-
Send a Message to a Group
-
Send an Adaptive Card
-
Get Chat ID for Group by Name
- Get Chat ID for One-on-One Chat
Examples in Controllers
Here’s an example of sending a group message inside a controller:
Testing
Run unit tests for the package:
Contributing
Contributions are welcome! Please fork this repository, create a feature branch, and submit a pull request.
License
This package is open-sourced software licensed under the MIT license.
Contact
For issues, questions, or feedback, please contact Shahil via GitHub or open an issue in this repository.