dcblogdev / laravel-microsoft-graph

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

Posting to /users/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/onlineMeetings returns string #72

Closed ShaunWilders closed 3 months ago

ShaunWilders commented 5 months ago

When trying to create a Teams meeting, it works, but the returned JSON is a string so the following error is generated...

Dcblogdev\MsGraph\MsGraphAdmin::isJson(): Argument #1 ($data) must be of type object, string given, called in C:\xampp\htdocs\magna\vendor\dcblogdev\laravel-microsoft-graph\src\MsGraphAdmin.php on line 189

Code in use...

$graphresponse = MsGraphAdmin::post("/users/". config('msgraph.MeetingUserId') ."/onlineMeetings", [
            'subject' => $booking->subject,
            'startDateTime' => $booking->start_time,
            'endDateTime' => $booking->end_time,
        ]);

Is there a reason for line 165 being specified as an object?

If I take out "object" it all works fine...

protected function isJson(/*object*/ $data): bool

boskee commented 4 months ago

Same with get to user/

It makes absolutely no sense to have this typed as object given the contents of the function

ShaunWilders commented 3 months ago

@dcblogdev - any chance of a quick fix?

dcblogdev commented 3 months ago

I've removed the object type hint, thank for letting me now.

https://github.com/dcblogdev/laravel-microsoft-graph/releases/tag/v3.2.6