-
Notifications
You must be signed in to change notification settings - Fork 1
User Profile Photo
PrasadChinwal edited this page Dec 10, 2024
·
1 revision
- Get user photo Documentation
use PrasadChinwal\MicrosoftGraph\Facades\MicrosoftGraph;
$image = MicrosoftGraph::users()->withEmail('abc@xxx.xxx.xxx')->getPhoto('48', '48');
dd($image);
Returns Base 64 string. Can be used in image tag as:
<img src="data:image/png;base64, {{ base64_encode($image) }}" alt="Profile Photo"/>
- Update user photo Documentation
$image = file_get_contents('path_to_your_image/your_photo.jpeg');
$image = MicrosoftGraph::users()->withEmail('abx@xxx.xxxx.xxx')->updatePhoto($image);
dd($image);
On Success returns base 64 of image
<img src="data:image/png;base64, {{ base64_encode($image) }}" alt="Profile Photo"/>