Download the PHP package lloadout/microsoftgraph without Composer

On this page you can find all versions of the php package lloadout/microsoftgraph. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package microsoftgraph

Latest Version on Packagist Total Downloads

Microsoft graph

Use case

Laravel package for using Microsoft mail, OneDrive, Teams, Excel, Calendars and Contacts

This package makes a wrapper around the Microsoft Graph API.

  1. It provides a Mail driver for Microsoft mail.
  2. It provides a storage driver for OneDrive.
  3. It provides functionality to interact with Microsoft Teams.
  4. It provides the possibility to work with Excel, making it possible to write and read Excel files.
  5. It allows you to manage calendar events.
  6. It allows you to manage contacts.
  7. It allows you to read and handle mail.

You need to register an app in the Microsoft Azure Portal to use this package. Follow the steps in the Microsoft docs: https://docs.microsoft.com/en-us/graph/auth-register-app-v2

Installation

You can install the package via composer:

Add this to your .env file and fill it with the values you specified in Microsoft Azure Portal app registration.
If you created a multi-tenant app in Azure AD than you don't put your tentant id into the MS_TENANT_ID variable but you set it to common.

Connect your account

The package uses OAuth and provides two routes

The first redirects you to the consent screen of Microsoft

The second is the callback url you need to specify in Microsoft Azure Portal app registration as redirect uri

The callback will fire an MicrosoftGraphCallbackReceived event, this will automatically store your token in the session. You can add your token store logic in a listener for this event, for example:

The package will search for a session variable name microsoftgraph-access-data for establishing the connection. So please provide this variable with your accessData as value when logging in. For example: On login, you get your accesData from the database and store it into the session variable microsoftgraph-access-data.

Mail usage

Configuration

You have to provide this API permissions: Mail.send

Set the environment variable MAIL_MAILER in your .env file

note: make sure your from address is the address you gave the consent to

Usage

Reading and handling mail

You have to provide this API permissions: Mail.Read, Mail.ReadWrite, Mail.ReadBasic

Available methods

Storage usage

Configuration

You have to provide this API permissions: Files.ReadWrite.all

add the onedrive root to your .env file:

Available methods

All methods from the Laravel Storage facade are available. https://laravel.com/docs/8.x/filesystem#configuration

Usage

The package created a disk called onedrive. This means that you can use all the methods as described in the Laravel docs: https://laravel.com/docs/8.x/filesystem#configuration

Teams usage

Configuration

You have to provide this API permissions: Chat.ReadWrite

Available methods

Usage

First instantiate the Teams class

Get all the teams you are a member of ( additional permissions needed: Group.Read.All )

Get alle the channels for a team ( additional permissions needed: Group.Read.All )

Get all the chats for a user ( additional permissions needed: Chat.Read.All )

Get a chat by a given id ( additional permissions needed: Chat.Read.All )

Get all the members in a channel ( additional permissions needed: ChannelMessage.Read.All )

Send a message to a channel ( additional permissions needed: ChannelMessage.Send )

Excel usage

Configuration

You have to provide this API permissions: Files.ReadWrite.all

Available methods

Usage

First instantiate the Excel class

Load a file from OneDrive

Load a file by its id

Set cell values of a range

Calendar usage

Configuration

You have to provide this API permissions: Calendars.ReadWrite

Available methods

Usage

First instantiate the Calendar class

Get all the calendars

Get all the events for a calendar

Save an event to a calendar, the event object is a MicrosoftGraphEvent object We made a helper function to create an event object Calendar::makeEvent(string $starttime, string $endtime, string $timezone, string $subject, string $body, array $attendees = [], bool $isOnlineMeeting = false)

Contacts usage

Configuration

You have to provide this API permissions: Contacts.ReadWrite

Available methods

Usage

First instantiate the Contacts class

Get all the contacts

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of microsoftgraph with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-fileinfo Version *
illuminate/contracts Version ^9|^10.0|^11.0
microsoft/microsoft-graph Version ^1.89
socialiteproviders/microsoft Version ^4.2
spatie/laravel-package-tools Version ^1.14.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lloadout/microsoftgraph contains the following files

Loading the files please wait ....