mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 16:22:14 +00:00
create Socialite Login/Register
This commit is contained in:
@@ -1012,4 +1012,35 @@ if (! function_exists('replace_occurrence')) {
|
||||
$string
|
||||
);
|
||||
}
|
||||
|
||||
if(! function_exists('get_socialite_avatar')) {
|
||||
/**
|
||||
* Get socialite avatar create and store his thumbnails
|
||||
*/
|
||||
function get_socialite_avatar($avatar)
|
||||
{
|
||||
$image = file_get_contents($avatar);
|
||||
|
||||
// Generate avatar name
|
||||
$avatar_name = Str::uuid() . '.jpg';
|
||||
|
||||
// Create intervention image
|
||||
$intervention = Image::make($image);
|
||||
|
||||
// Generate avatar sizes
|
||||
collect(config('vuefilemanager.avatar_sizes'))
|
||||
->each(function ($size) use ($intervention, $avatar_name) {
|
||||
|
||||
// fit thumbnail
|
||||
$intervention->fit($size['size'], $size['size'])->stream();
|
||||
|
||||
// Store thumbnail to disk
|
||||
Storage::put("avatars/{$size['name']}-{$avatar_name}", $intervention);
|
||||
});
|
||||
|
||||
// Return path to image
|
||||
return $avatar_name;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user