From ed1092463ba60de7a642133540b9bea8aada4f2a Mon Sep 17 00:00:00 2001 From: ChrisSchuessler <100433213+ChrisSchuessler@users.noreply.github.com> Date: Wed, 7 May 2025 21:22:17 +0200 Subject: [PATCH 1/9] Create CONTRIBUTORS.md --- CONTRIBUTORS.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 CONTRIBUTORS.md diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md new file mode 100644 index 0000000..9e5d8f7 --- /dev/null +++ b/CONTRIBUTORS.md @@ -0,0 +1,6 @@ +# Contributors + +Dieses Projekt wird von folgenden Personen gepflegt und weiterentwickelt: + +- **[Der Schuessi](https://github.com/ChrisSchuessler)** – Fork-Initiator +- **[EL OUFIR Hatim](https://github.com/heloufir)** – Ursprünglicher Ersteller From f148c9740b989ea4cf154ac718304397d93e4b03 Mon Sep 17 00:00:00 2001 From: ChrisSchuessler <100433213+ChrisSchuessler@users.noreply.github.com> Date: Wed, 7 May 2025 21:27:19 +0200 Subject: [PATCH 2/9] Update README.md --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 33d7429..7ee40da 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,20 @@ return [ // User's field used to generate avatar 'name_field' => 'email' + + // Default Gravatar Types: + // initials: uses the profile name as initials, with a generated background and foreground color (beta). There are additional parameters, described later. + // color: a generated color (beta) + // 404: do not load any image if none is associated with the email hash, instead return an HTTP 404 (File Not Found) response + // mp: (mystery-person) a simple, cartoon-style silhouetted outline of a person (does not vary by email hash) + // identicon: a geometric pattern based on an email hash + // monsterid: a generated ‘monster’ with different colors, faces, etc + // wavatar: generated faces with differing features and backgrounds + // retro: awesome generated, 8-bit arcade-style pixelated faces + // robohash: a generated robot with different colors, faces, etc + // blank: a transparent PNG image (border added to HTML below for demonstration purposes) + 'default_avatar' => false, + ], ], From 3edb2e487b8051ef119ec8b0ca9a4aaebef1fec8 Mon Sep 17 00:00:00 2001 From: ChrisSchuessler <100433213+ChrisSchuessler@users.noreply.github.com> Date: Wed, 7 May 2025 21:28:40 +0200 Subject: [PATCH 3/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7ee40da..cb19171 100644 --- a/README.md +++ b/README.md @@ -145,7 +145,7 @@ For fast support, please join the [**Filament** community](https://filamentphp.c ## Credits - [heloufir](https://github.com/heloufir) -- [All Contributors](https://github.com/devaslanphp/filament-avatar/graphs/contributors) +- [All Contributors](https://github.com/chrisschuessler/filament-avatar/contributors) ## License From 202f082ae8215ade73439c27a45ed9a9278c952d Mon Sep 17 00:00:00 2001 From: ChrisSchuessler <100433213+ChrisSchuessler@users.noreply.github.com> Date: Wed, 7 May 2025 21:32:43 +0200 Subject: [PATCH 4/9] Update filament-avatar.php --- config/filament-avatar.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config/filament-avatar.php b/config/filament-avatar.php index 0f37f76..4215bc7 100644 --- a/config/filament-avatar.php +++ b/config/filament-avatar.php @@ -57,7 +57,10 @@ 'url' => 'https://www.gravatar.com/avatar/', // User's field used to generate avatar - 'name_field' => 'email' + 'name_field' => 'email', + + // Default Gravatar Types => https://docs.gravatar.com/sdk/images/ + 'default_avatar' => false, ], ], From 068bd91b0d144a441073f90634eeacc2e51c4987 Mon Sep 17 00:00:00 2001 From: ChrisSchuessler <100433213+ChrisSchuessler@users.noreply.github.com> Date: Wed, 7 May 2025 21:33:38 +0200 Subject: [PATCH 5/9] Update README.md Extended config file description --- README.md | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index cb19171..7b6ffe7 100644 --- a/README.md +++ b/README.md @@ -100,19 +100,9 @@ return [ 'url' => 'https://www.gravatar.com/avatar/', // User's field used to generate avatar - 'name_field' => 'email' - - // Default Gravatar Types: - // initials: uses the profile name as initials, with a generated background and foreground color (beta). There are additional parameters, described later. - // color: a generated color (beta) - // 404: do not load any image if none is associated with the email hash, instead return an HTTP 404 (File Not Found) response - // mp: (mystery-person) a simple, cartoon-style silhouetted outline of a person (does not vary by email hash) - // identicon: a geometric pattern based on an email hash - // monsterid: a generated ‘monster’ with different colors, faces, etc - // wavatar: generated faces with differing features and backgrounds - // retro: awesome generated, 8-bit arcade-style pixelated faces - // robohash: a generated robot with different colors, faces, etc - // blank: a transparent PNG image (border added to HTML below for demonstration purposes) + 'name_field' => 'email', + + // Default Gravatar Types => https://docs.gravatar.com/sdk/images/ 'default_avatar' => false, ], From 398db9a91e63a3f6cb42d4199363f1101ecce065 Mon Sep 17 00:00:00 2001 From: ChrisSchuessler <100433213+ChrisSchuessler@users.noreply.github.com> Date: Wed, 7 May 2025 21:36:07 +0200 Subject: [PATCH 6/9] Update composer.json Added contributor --- composer.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/composer.json b/composer.json index ab5c3cc..79ae83a 100644 --- a/composer.json +++ b/composer.json @@ -22,6 +22,12 @@ { "name": "EL OUFIR Hatim", "email": "eloufirhatim@gmail.com" + }, + { + "name": "Der Schuessi [ Christoph Schüßler @ solisTEC ]", + "email": "chris@solistec.de", + "homepage": "https://solistec.de", + "role": "Contributor" } ], "extra": { From 7e47a05bb10f0b70798e6e471c13127ea542a884 Mon Sep 17 00:00:00 2001 From: ChrisSchuessler <100433213+ChrisSchuessler@users.noreply.github.com> Date: Wed, 7 May 2025 21:41:18 +0200 Subject: [PATCH 7/9] Update README.md --- README.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 7b6ffe7..442e515 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ -# Filament Avatar +# solisTEC Filament Gravatar -[![Latest Version on Packagist](https://img.shields.io/packagist/v/devaslanphp/filament-avatar.svg?style=flat-square)](https://packagist.org/packages/devaslanphp/filament-avatar) -[![Total Downloads](https://img.shields.io/packagist/dt/devaslanphp/filament-avatar.svg?style=flat-square)](https://packagist.org/packages/devaslanphp/filament-avatar) +Based on the beautiful Gravatar implementation Filament Avatar of heloufir [https://github.com/heloufir] This package provides a complete and customizable User Avatar provider for your Filament project, and also for any project using a User Model. @@ -128,12 +127,9 @@ This package can be used outside of **Filament** too, you can add the trait `Dev This trait will give you access to an appended attribute `avatarUrl` generated by the avatar provider, then you can use it as a `src` of your images. -## Support - -For fast support, please join the [**Filament** community](https://filamentphp.com/discord) discord and send me a message in this channel [#avatar-provider](https://discord.com/channels/883083792112300104/1022104259644362823) - ## Credits +- [Der Schuessi @ solisTEC](https://github.com/ChrisSchuessler) - [heloufir](https://github.com/heloufir) - [All Contributors](https://github.com/chrisschuessler/filament-avatar/contributors) From b58e344fd668cf4b09e28dcaadae0b47277a4116 Mon Sep 17 00:00:00 2001 From: ChrisSchuessler <100433213+ChrisSchuessler@users.noreply.github.com> Date: Wed, 7 May 2025 21:43:39 +0200 Subject: [PATCH 8/9] Update README.md --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 442e515..1ffe0fe 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,4 @@ -# solisTEC Filament Gravatar - -Based on the beautiful Gravatar implementation Filament Avatar of heloufir [https://github.com/heloufir] +# Filament Avatar This package provides a complete and customizable User Avatar provider for your Filament project, and also for any project using a User Model. @@ -127,11 +125,14 @@ This package can be used outside of **Filament** too, you can add the trait `Dev This trait will give you access to an appended attribute `avatarUrl` generated by the avatar provider, then you can use it as a `src` of your images. +## Support + +For fast support, please join the Filament community discord and send me a message in this channel #avatar-provider + ## Credits -- [Der Schuessi @ solisTEC](https://github.com/ChrisSchuessler) - [heloufir](https://github.com/heloufir) -- [All Contributors](https://github.com/chrisschuessler/filament-avatar/contributors) +- [Der Schuessi @ solisTEC](https://github.com/ChrisSchuessler) as contributor ## License From a8717fe27850f30b02602dc23bf3bf45b806fc77 Mon Sep 17 00:00:00 2001 From: ChrisSchuessler <100433213+ChrisSchuessler@users.noreply.github.com> Date: Wed, 7 May 2025 21:45:32 +0200 Subject: [PATCH 9/9] Update GravatarProvider.php Added default gravatar var --- src/Core/GravatarProvider.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Core/GravatarProvider.php b/src/Core/GravatarProvider.php index 12a3c7f..ed70fee 100644 --- a/src/Core/GravatarProvider.php +++ b/src/Core/GravatarProvider.php @@ -17,6 +17,7 @@ class GravatarProvider public function get(Model $user): string { $name = md5($user->{config('filament-avatar.providers.gravatar.name_field')}); + $default = is_null(config('filament-avatar.providers.gravatar.default_avatar')) ? '' : config('filament-avatar.providers.gravatar.default_avatar'); return config('filament-avatar.providers.gravatar.url') . '' . $name; }