creativeorange / gravatar Goto Github PK
View Code? Open in Web Editor NEWA Laravel Gravatar package for retrieving gravatar image URLs or checking the existance of an image.
License: MIT License
A Laravel Gravatar package for retrieving gravatar image URLs or checking the existance of an image.
License: MIT License
Avoid error when allow_url_fopen is disabled
The settings file (vendor/creativeorange/gravatar/config/gravatar.php) is not being applied to the production site because the vendor directory is in .gitignore so as soon as the site is deployed, the default settings are installed.
Is there a way to have the gravatar.php config file inside the app/config directory as some other vendor settings are?
Hey,
just upgraded my application to Laravel 5.2, but I get an error because of this deprecated function "bindShared". (http://laravel.com/docs/5.2/upgrade#upgrade-5.2.0)
Is this package really ready for Laravel 5.2? Could you update the package?
Cheers
Christoph
Gravatar::fallback($googleMapsImgUrl)->get($dbContact->emailAddress);
does not seem to use the fallback URL at all.
In fact, my Netbeans IDE shows that none of these functions in Gravatar.php
get used at all:
sizeParameter
defaultParameter
ratingParameter
forceDefaultParameter
Gravatar::exists($emailAddress)
and Gravatar::get($emailAddress)
seem to work, though, so I'm using those.
Thanks! :-)
P.S. I recommend also adding in your setup instructions that use Gravatar;
should be added at the top of whatever file we're calling it from. It took me a long time to figure that out. I was even accidentally trying use Creativeorange\Gravatar\Facades\Gravatar;
, which didn't work.
\Creativeorange\Gravatar\Facades\Gravatar::get($email, $configGroup)
$configGroup
needs to match the type in setConfig, otherwise, the IDE will warn that there's a type mismatch and we can't set an array as an option.
Resolved by PR #32
What about image caching for a certain period?
private function checkEmail($email)
use filter_var()
function with FILTER_VALIDATE_EMAIL as a second parameter. This is a problem because Laravel's email validator use different check for email.
For example Laravel consider maxim@localhost
as a valid email, but FILTER_VALIDATE_EMAIL does not.
Please, consider to change filter_var() with FILTER_VALIDATE_EMAIL to standard Laravel 'email' validator
Exception error when not connected to internet, fallback should handle such instances. Can you fix it?
Not sure if it's 5.4 specific but adding to a new project gave me:
"Invalid argument supplied for foreach()" pointing to \Illuminate\Support\Arr.php
Traced it down and looked like it just required me to make my the "default" entry in my gravitar config file an array instead of string:
'default' => 'identicon',
becomes:
'default' => ['identicon'],
I got this message:
Creativeorange\Gravatar\Exceptions\InvalidEmailException: Please specify a valid email address in /var/app/current/vendor/creativeorange/gravatar/src/Gravatar.php:267,
and the email es a valid one, is a gmail like this: username5544@gmail.
First, thanks for library. I found that Gravatar::exists() always returns true no matter what address you enter. Could I suggest you add the following as a check as this will return the right bool:
$email= "[email protected]"; //for testing
$gravemail = md5( strtolower( trim( $email ) ) );
$gravImage = "http://www.gravatar.com/avatar/".$gravemail;
$gravcheck = "http://www.gravatar.com/avatar/".$gravemail."?d=404";
$response = get_headers($gravcheck);
print_r($response);
if ($response[0] != "HTTP/1.0 404 Not Found"){
echo('FOUND');
$img = $gravImage;
} else {
echo('FOUND');
// execute fallback
}
if you use the fallback function the Gravatar is not updated with the latest picture
function get returns the latest one
Hello
When I install the package with composer it says that it installs the V1.0.10, but when I look at the vendor I see that composer.json doesn't have the discovery option for Laravel 5.5. So this is not the last version that is uploaded. I made the intallation many times and always the same result even if I clear composer cache...
I am using like below
$data['gravatar'] = (!empty(auth()->user()->email)) ? Gravatar::fallback(url('images/user.jpg'))->get(auth()->user()->email) : null;
But why my output is like below ?
<img id="userImg" class="userImg" src="https://secure.gravatar.com/avatar/a516098e1de8e2756fa4bf045c7a4cb2.jpg?s=150&d=http%3A%2F%2F127.0.0.1%3A8000%2Fimages%2Fuser.jpg&r=g" alt="user">
Could anyone help me in this regard ?
Hi, How can I download a Gravatar at the native size uploaded by the the user?
Description does not list Laravel 5.4 as one of supported versions. I will give it a whirl anyhow and report back (and issue a README PR if it does work) :-)
After a change in
Line 220 in 9057d98
Gravatar::get('[email protected]')
$this->fallback
is null by default.Love this package! It would be really nice to be able to set some options inline, such as the size. Finding that I am duplicating my configuration array several times for different image sizes.
Sorry, not familiar with how to label this as a request.. :)
This library should just use HTTPS all the time for Gravatar. There's no reason not to. Using HTTPS inside of a site that is currently using HTTP doesn't cause any problems, but clearly the reverse is not true.
HTTPS forever! ๐
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.