-
Notifications
You must be signed in to change notification settings - Fork 1
User Requests
PrasadChinwal edited this page Dec 10, 2024
·
3 revisions
- Get users: Documentation Retrieves all the users.
use PrasadChinwal\MicrosoftGraph\Facades\MicrosoftGraph;
$graph = MicrosoftGraph::users()->get();
dd($graph);
Response
Illuminate\Support\Collection {#668 ▼ // routes/graph.php:13
#items: array:100 [▼
0 => PrasadChinwal\MicrosoftGraph\Response\User\User {#663 ▼
#_additional: []
#_dataContext: null
+businessPhones: []
+displayName: "XXXXXXX"
+givenName: null
+jobTitle: null
+mail: null
+mobilePhone: null
+officeLocation: null
+preferredLanguage: null
+surname: null
+userPrincipalName: "XXXXXX"
+id: "XXXXXXXX"
}
- Get user from ID: Documentation Retrieves a user from principalName.
$graph = MicrosoftGraph::users()->find('abc@user.com');
dd($graph);
Response
PrasadChinwal\MicrosoftGraph\Response\User\User {#644 ▼ // routes/graph.php:17
#_additional: []
#_dataContext: null
+businessPhones: array:1 [▶]
+displayName: "XXXX"
+givenName: "XXXXX"
+jobTitle: "XXXXX"
+mail: "XXXX@XX.XXX"
+mobilePhone: null
+officeLocation: null
+preferredLanguage: null
+surname: "Chinwal"
+userPrincipalName: "XX@XXX.XXX.XXX"
+id: "1xXXXXXaaaXXX"
}
- Update user Documentation
use PrasadChinwal\MicrosoftGraph\Builder\User\User;
$user = new User();
$user->usageLocation = 'US';
$response = MicrosoftGraph::users()->update('XXXXX@XXXX.XXX.XXXX', $user);
dd($response);
Returns
true
orfalse
.