dcblogdev / laravel-microsoft-graph

Laravel package for Microsoft Graph API (Microsoft365)
https://dcblog.dev/docs/laravel-microsoft-graph
Other
122 stars 52 forks source link

"Array to string conversion" error when querying #27

Closed NWMF closed 2 years ago

NWMF commented 2 years ago

Hello, I keep getting this error whenever I try to run:

$emails = MsGraph::emails()->get([ "\$orderby" => "displayName", "\$top" => 100, "\$skip" => 0, "\$count" => "true", ]);

The error page: https://flareapp.io/share/w5BjNlD5#F51

It also happens when running for Contacts, Calendar etc...

I'm using Laravel 9.17.0 - PHP 8.1.6 running on localhost using Valet for Windows.

Permissions are all good, authentication is working well too.

dcblogdev commented 2 years ago

the get method expected a folder id and then an array of options ie:

$emails = MsGraph::emails()->get('inbox', ["\$top" => 100, "\$skip" => 0, "\$count" => "true" ]);

I need to update the docs.

MilesHart commented 1 year ago

I found this also works.

$rtn = MsGraph::emails()->top(20)->get();