Skip to content

Releases: dcblogdev/laravel-microsoft-graph

v3.1.5

04 Sep 16:37
Compare
Choose a tag to compare

Added

  • added commands msgraphadmin:keep-alive and msgraph:keep-alive to allow refresh tokens to be automated by running these commands on a schedule
  • added support in Files.php to support replace/rename behavior on createFolder and file upload functions. Default behavior is to rename.

Usage for createFolder:

MsGraph::files()->createFolder($name, $path, $type = 'me', $behavior='rename')

Where $behavior is either rename or replace

Usage for upload:

MsGraph::files()->upload($name, $uploadPath, $path=null, $type='me',$behavior='rename')

Where $behavior is either rename or replace

v3.1.4

03 Sep 10:49
Compare
Choose a tag to compare

Added

  • Test foundation using PestPHP
  • PHP code sniffer fixer and style config

Changed

  • MSGRAPH_DB_CONNECTION to be mysql to use a connection called mysql
  • Store name is email cannot be found when connecting
  • Changed responses so if the data is json it gets decoded otherwise the raw body is returned
  • Msgraph::emails->get($folderId, $params) returns error when mailbox folder not found

Fixed

  • used MsGraphAdmin instead of MsGraph in admin files resource

Added missing files import

18 Aug 22:55
Compare
Choose a tag to compare
v3.1.3

updated change log

added support for Laravel 9

29 Jan 14:27
Compare
Choose a tag to compare
v3.1.2

updated change log

updated getPagination method on MsGraph.php

28 Aug 21:40
Compare
Choose a tag to compare

Changed getPagination() to return array containing only previous and next page numbers.

This method needs the data but also the total number of records, the limit ($top) and the offset ($skip)

$limit = 5;
$skip  = request('next', 0);

$messageQueryParams = [
	"\$orderby" => "displayName",
	"\$count"   => "true",
	"\$skip"    => $skip,
	"\$top"     => $limit,
];

$contacts = MsGraph::get('me/contacts?'.http_build_query($messageQueryParams));
$total    = $contacts['@odata.count'] ?? 0;

$response = MsGraph::getPagination($contacts, $total, $limit, $skip);
$previous = $response['previous'];
$next     = $response['next'];

The in a view the previous and next links can be displayed:

@if (request('next') > 0)
	<a href='{{ url()->current().'?next='.$previous }}'>Previous Page</a>
@endif

@if ($next != 0)
	<a href='{{ url()->current().'?next='.$next }}'>Next Page</a>
@endif

MsGraphAdmin classes for calendar

24 Aug 13:30
Compare
Choose a tag to compare

Added classes for MsGraphAdmin for working with Calendars and Events

Calendar Events

MsGraphAdmin::calendarEvents()->userid($userId)->get();
MsGraphAdmin::calendarEvents()->userid($userId)->find($calendarId, $eventId);
MsGraphAdmin::calendarEvents()->userid($userId)->store($calendarId, $data);

Calendars

MsGraphAdmin::calendars()->userid($userId)->get();
MsGraphAdmin::calendars()->userid($userId)->find($eventId);
MsGraphAdmin::calendars()->userid($userId)->store($data);
MsGraphAdmin::calendars()->userid($userId)->update($data);

Events

MsGraphAdmin::events()->userid($userId)->get();
MsGraphAdmin::events()->userid($userId)->find($eventId);
MsGraphAdmin::events()->userid($userId)->store($data);
MsGraphAdmin::events()->userid($userId)->update($data);
MsGraphAdmin::events()->userid($userId)->delete($data);

Added support for prefix paths in files resource

14 Aug 23:53
Compare
Choose a tag to compare

Changed files to support passing the prefix to the paths such as me or groups/$groupId or sites.

Example

//set a custom prefix to a set group
MsGraph::files()->getFiles($this->path, "groups/$groupId");

//use the default (me)
MsGraph::files()->getFiles($this->path);

added file methods

07 Feb 15:59
Compare
Choose a tag to compare

Added methods:

List files and folders

MsGraph::files()->getFiles($path = null, $order = 'asc');

List drive

MsGraph::files()->getDrive();

List drives

MsGraph::files()->getDrives();

Search items

MsGraph::files()->search($term);

Download file by id

MsGraph::files()->downloadFile($id)

Delete file by id

MsGraph::files()->deleteFile($id)

Create folder pass the folder and the path where the folder will be created if no path is provided the root is used.

MsGraph::files()->createFolder($name, $path = null)

Get file/folder item by id

MsGraph::files()->getItem($id)

Rename file/folder pass the new name and the id

MsGraph::files()->rename($name, $id)

Upload file passes the name and the uploadPath (where the file is on your server) and the path to where the file will be stored if no path is provided the root is used.

MsGraph::files()->upload($name, $uploadPath, $path = null)

Fix issue when connecting with specified ID

27 Jan 20:55
9cf5c5b
Compare
Choose a tag to compare
Merge pull request #14 from stromgren/explicit-id

Fix issue when connecting with specified ID

supports login ability

31 Dec 10:15
9c5c24a
Compare
Choose a tag to compare

Added new methods: isConnected() and disconnect()
fires an event when a user logs in
config uses tenant id for authorise urls when set in .env
added a publishing option for listeners
added an event NewMicrosoft365SignInEvent that fires on login.