Releases: dcblogdev/laravel-microsoft-graph
changed migration to anonymous migration
v3.1.7 changed migration to anonymous migration
add support for Laravel 10
Merge pull request #47 from laravel-shift/l10-compatibility Laravel 10.x Compatibility
v3.1.5
Added
- added commands
msgraphadmin:keep-alive
andmsgraph: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 fileupload
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
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
v3.1.3 updated change log
added support for Laravel 9
v3.1.2 updated change log
updated getPagination method on MsGraph.php
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
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
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
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)