PHP code example of apility / microsoft-graph-api

1. Go to this page and download the library: Download apility/microsoft-graph-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

apility / microsoft-graph-api example snippets


use Microsoft\GraphAPI\Facades\GraphAPI;

$me = GraphAPI::get('/me')->json();

'disks' => [
    'microsoft' => [
        'driver' => 'microsoft',
        'site_id' => env('MICROSOFT_GRAPH_API_SITE_ID'),
    ],
],

$files = Storage::disk('microsoft')->allFiles('path');

use Microsoft\GraphAPI\GraphAPI\Client;
use Microsoft\GraphAPI\GraphAPI\Auth\Credentials;

$credentials = new Credentials(
    '<your-tenant-id>',
    '<your-app-id>',
    '<your-client-secret>'
);

$client = new Client($credentials);

$me = $client->get('/me');
bash
php artisan vendor:publish --provider="Microsoft\GraphAPI\ServiceProvider" --tag="config"