{"id":29420044,"url":"https://github.com/allebb/gravel","last_synced_at":"2025-07-22T19:35:41.454Z","repository":{"id":62491444,"uuid":"9778899","full_name":"allebb/gravel","owner":"allebb","description":"A PHP Gravatar.com library enabling developers to easily access, display and manipulate user avatars in their applications.","archived":false,"fork":false,"pushed_at":"2025-01-09T01:07:55.000Z","size":178,"stargazers_count":13,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-12T01:15:33.921Z","etag":null,"topics":["avatar","gravatar","gravatar-library","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/allebb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2013-04-30T19:56:11.000Z","updated_at":"2024-10-29T19:21:59.000Z","dependencies_parsed_at":"2025-07-13T03:02:10.320Z","dependency_job_id":null,"html_url":"https://github.com/allebb/gravel","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/allebb/gravel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allebb%2Fgravel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allebb%2Fgravel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allebb%2Fgravel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allebb%2Fgravel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/allebb","download_url":"https://codeload.github.com/allebb/gravel/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allebb%2Fgravel/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266561517,"owners_count":23948632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["avatar","gravatar","gravatar-library","php"],"created_at":"2025-07-12T01:15:27.486Z","updated_at":"2025-07-22T19:35:41.430Z","avatar_url":"https://github.com/allebb.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Gravel\n======\n\n[![Build](https://github.com/allebb/gravel/workflows/build/badge.svg)](https://github.com/allebb/gravel/actions)\n[![Code Coverage](https://codecov.io/gh/allebb/gravel/branch/master/graph/badge.svg)](https://codecov.io/gh/allebb/gravel)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/allebb/gravel/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/allebb/gravel/?branch=master)\n[![Code Climate](https://codeclimate.com/github/allebb/gravel/badges/gpa.svg)](https://codeclimate.com/github/allebb/gravel)\n[![Latest Stable Version](https://poser.pugx.org/ballen/gravel/v/stable)](https://packagist.org/packages/ballen/gravel)\n[![Latest Unstable Version](https://poser.pugx.org/ballen/gravel/v/unstable)](https://packagist.org/packages/ballen/gravel)\n[![License](https://poser.pugx.org/ballen/gravel/license)](https://packagist.org/packages/ballen/gravel)\n\n[Gravel](https://github.com/allebb/gravel) is a PHP library for working with [Gravatar](http://www.gravatar.com) avatars.\n\nGravel is written and maintained by [Bobby Allen](http://bobbyallen.me), the library is licensed under the [MIT license](LICENSE).\n\nRequirements\n------------\n\nThis library is developed and tested for PHP 7.3+\n\nThis library is unit tested against PHP 7.3, 7.4, 8.0, 8.1 and 8.2!\n\nIf you need to use an older version of PHP, you should instead install the 2.x version of this library (see below for details).\n\nLicense\n-------\n\nThis client library is released under the MIT license, a [copy of the license](https://github.com/allebb/gravel/blob/master/LICENSE) is provided in this package.\n\nInstallation\n------------\n\nThe recommended way of installing the latest version of Gravel is via. [Composer](http://getcomposer.org); To install using Composer type the following command at the console:\n\n```shell\ncomposer require ballen/gravel\n```\n\nYou can also manually download the latest version as a [zip](https://github.com/allebb/gravel/archive/master.zip) or [tar.gz](https://github.com/allebb/gravel/archive/master.tar.gz) archive of the library from GitHub and 'include' the `Gravatar.php` script (library) and use it standalone if you wish.\n\n**If you need to use an older version of PHP, version 2.x.x supports PHP 5.3, 5.4, 5.5, 5.6, 7.0, 7.1 and 7.2, you can install this version using Composer with this command instead:**\n\n```shell\ncomposer require ballen/gravel ^2.0\n```\n\n### Laravel Integration\n\nGravel has optional support for [Laravel](http://www.laravel.com) 4.x, 5.x, 6.x, 7.x and 8.x; it comes with a **Service Provider** which will register the **Facade** for easy integration.\n\nOn Laravel 7.x and 8.x this will be auto-discovered and no need to add it to the ``config/app.php`` ``$providers`` array!\n\nIf you are using an earlier version of Laravel you will need to manually enable this, which can be achieved by opening your Laravel application's configuration file ``config/app.php`` (or ``app/config/app.php`` if you are using Laravel 4.x) and add the following lines.\n\nIn the `$providers` array add the service providers for this package.\n\n```php\nBallen\\Gravel\\GravelServiceProvider::class,\n```\n\nThe Gravatar package will now be autoloaded by the Laravel framework (via. Composer) and use of the library is as simple...\n\nExample usage\n-------------\n\nIf you have installed the library using Composer or manually you can (as long as your application already `requires` or `includes` the composer `autoload.php`) then you can instantiate a new object instance and use it immediately in your application like so:\n\n```php\nuse Ballen\\Gravel\\Gravatar;\n\n$avatar = new Gravatar('bobbyallen.uk@gmail.com');\n$avatar-\u003esetSize(100); // We want a 100x100px sized avatar instead of the default 120x120px\n\n/**\n* You can then obtain the avatar URL either by using the buildGravatarUrl() method or utilising\n* the __toString() class method like so:\n*/\n\u003cimage src=\"\u003c?php echo $avatar; ?\u003e\"\u003e\n```\n\nThere are a number of other \"commented\" examples on how you can utilise this library can be found in the ``examples/Examples.php`` file.\n\n### Laravel example\n\nI decided to implement a Laravel type style (`make()`, `get()`) for the Laravel Facades therefore it should keep both the hardcore developers (setter and getter prefixed methods) as well as those developers that appreciate cleanly written method names!\n\nIf you have added the Laravel Service Provider and Aliases as documented above, you can utilise the library like so:\n\n```php\n# Laravel 4.x example\nreturn View::make('userprofile')\n    -\u003ewith('gravatar', Gravatar::make('bobbyallen.uk@gmail.com')-\u003esize(200)-\u003eget());\n\n# Laravel 5.x and 6.x example (using the view() helper method)\nreturn view('userprofile')\n    -\u003ewith('gravatar', Gravatar::make('bobbyallen.uk@gmail.com')-\u003esize(200)-\u003eget());\n\n```\n\nTests and coverage\n------------------\n\nThis library is fully unit tested using [PHPUnit](https://phpunit.de/).\n\nI use [GitHub Actions](https://github.com/) for continuous integration, which triggers tests for PHP 7.3, 7.4, 8.0, 8.1 and 8.2 every time a commit is pushed.\n\nIf you wish to run the tests yourself you should run the following:\n\n```shell\n# Install the Gravel Library with the 'development' packages this then includes PHPUnit!\ncomposer install\n\n\n# Now we run the unit tests (from the root of the project) like so:\n./vendor/bin/phpunit\n```\n\nCode coverage can also be ran and a report generated (this does require XDebug to be installed)...\n\n```shell\n./vendor/bin/phpunit --coverage-html ./report\n```\n\nSupport\n-------\n\nI am happy to provide support via. my personal email address, so if you need a hand drop me an email at: [ballen@bobbyallen.me]().\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallebb%2Fgravel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallebb%2Fgravel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallebb%2Fgravel/lists"}