Currently seeking new career opportunities in web development, particularly with Laravel, Hire Me

Laravel package MsGraph

David Carr

Laravel Framework Microsoft Graph API PHP & MySQL Packages

I've released a new Laravel package called MsGraph that's essentially a wrapper for working with Microsoft Graph API.

https://github.com/daveismynamelaravel/MsGraph

The package comes with a few trait classes to offer simpler functions to working with Mail, Contacts and ToDo's more will be coming over the new few months. MsGraph can also be used to call an API endpoint directly.

For instance to get a users emails:

MsGraph::get('me/messages');

or using a trait method:

Msgraph::getEmails();

When working with the endpoint you use MsGraph:: followed by the HTTP verb (get, post, put, patch or delete) then the endpoint URL and where needed an array of data.

For instance to create a contact:

$data = [
	'displayName' => request('name'),
	'givenName' => request('name'),
	'emailAddresses' => [[
		'address' => request('email'),
		'name' => request('name')
	]]
];

MsGraph::post("me/contacts", $data);

//OR use the trait
MsGraph::createContact($data);

This makes working with the Graph API simpler, I'll be writing tutorials on different use cases soon. In the meantime give it a whirl. https://github.com/daveismynamelaravel/MsGraph

Laravel Modules Your Logo Your Logo Your Logo

Become a sponsor

Help support the blog so that I can continue creating new content!

Sponsor

My Latest Book

Modular Laravel Book - Laravel: The Modular way

Learn how to build modular applications with Laravel Find out more

Subscribe to my newsletter

Subscribe and get my books and product announcements.

Learn Laravel with Laracasts

Faster Laravel Hosting

© 2006 - 2024 DC Blog. All code MIT license. All rights reserved.