Example of Laravolt/avatar in realodix/urlhub

File composer.json (link to Github)
{
    "require": {
        "php": "^8.0",
        //
        "laravolt/avatar": "^4.1",
    }
}
File app/Models/User.php (link to Github)
use Illuminate\Foundation\Auth\User as Authenticatable;
use Laravolt\Avatar\Facade as Avatar;

class User extends Authenticatable
{
    public function getAvatarAttribute()
    {
        //
        return Avatar::create(Str::title($this->email))->toBase64();
    }
}

Additional resources on laravolt/avatar: