miguel_costa/office365api

First test of connection to Microsoft Graph API 1.0


Keywords
Miguel_Costa, Office365API
License
MIT

Documentation

Office 365 Connection to Graph API Laravel 5

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

This is the first test of a package to Laravel 5 , actually is already working, is getting the connection to the Microsoft Graph api correctly, as soon as i can i will document this file better, The purpose of the project is getting bigger and extends the classes with all the options of their API (send emails, read emails, control the calendar, create events, create users, etc).

Install

Via Composer

$ composer require miguel_costa/office365api

Add the provider in the file app.php at folder config

Miguel_Costa\Office365API\Office365APIServiceProvider::class,

Publish the config file in your folder config/Office365API.php

$ php artisan vendor:publish

Finally, configure the file Office365API.php at config folder with your credentials of your API at Microsoft Dev Portal
App Registration Portal

    'CLIENT_ID' => 'your id string goes here...',
    'CLIENT_SECRET' => 'your secret key goes here...',
    'REDIRECT_URI' => 'your redirect url, Should be the route of laravel where will redirect once the connection is finished',

Usage

//use the namespace corretly on your controller
use Miguel_Costa\Office365API\ConnectAPI;

//example of function to make the connection
public function redirect_connect() {
ConnectAPI::connect_officeAPI();
}

//get the connection and redirect the user to the intended page
public function get_connection() {
ConnectAPI::get_connection();
return view('home');
}

Get the connection at the blade view: The connection saves an Session variable of the username and email, so after making the connection you can access the variables like that:

@if(Session::has('office365_name'))
<p>Welcome, <b>{{Session::get('office365_name')}}</b></p>
<p>You are logged in with the Office365 Account:<b>{{Session::get('office365_email')}}</b></p>
@endif

Change log

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email "tga_miguel_tga@hotmail.com" instead of using the issue tracker.

Credits

License

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