awcodes/filament-gravatar

trim(): Passing null to parameter #1 ($string) of type string is deprecated error on $email == null

Closed this issue · 2 comments

error:

trim(): Passing null to parameter #1 ($string) of type string is deprecated

in Gravatar.php

$url .= md5(strtolower(trim($email)));

my workaround for now:

if ($email) {
   $url .= md5(strtolower(trim($email)));
}

Why is email null? Gravatar requires an email to work properly.

I think because i use filament tenancy with an other model than User…?

Also the function parameter accepts null (and sets as default null…