mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-19 08:32:14 +00:00
added socialite provider for the user
This commit is contained in:
@@ -344,14 +344,7 @@ if (! function_exists('store_avatar')) {
|
||||
$intervention = Image::make($image->getRealPath());
|
||||
|
||||
// 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);
|
||||
});
|
||||
generate_avatar_thumbnails($intervention, $avatar_name);
|
||||
|
||||
// Return path to image
|
||||
return $avatar_name;
|
||||
@@ -1017,30 +1010,40 @@ 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;
|
||||
}
|
||||
function store_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
|
||||
generate_avatar_thumbnails($intervention, $avatar_name);
|
||||
|
||||
// Return name of image
|
||||
return $avatar_name;
|
||||
}
|
||||
}
|
||||
|
||||
if(! function_exists('generate_avatar_thumbnails')) {
|
||||
/**
|
||||
* Create avatar thumbnails
|
||||
*/
|
||||
function generate_avatar_thumbnails($intervention, $avatar_name)
|
||||
{
|
||||
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);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user