Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tomshaw/laravel-gravatar
An easy to use Laravel Gravatar directive.
https://github.com/tomshaw/laravel-gravatar
Last synced: 11 days ago
JSON representation
An easy to use Laravel Gravatar directive.
- Host: GitHub
- URL: https://github.com/tomshaw/laravel-gravatar
- Owner: tomshaw
- License: mit
- Created: 2024-03-29T23:31:12.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2024-04-11T07:13:54.000Z (7 months ago)
- Last Synced: 2024-04-14T04:44:29.008Z (7 months ago)
- Language: PHP
- Homepage:
- Size: 35.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Laravel Gravatar 📸
A zero config named parameter Laravel Gravatar Directive.
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/tomshaw/laravel-gravatar/run-tests.yml?branch=master&style=flat-square&label=tests)
![issues](https://img.shields.io/github/issues/tomshaw/laravel-gravatar?style=flat&logo=appveyor)
![forks](https://img.shields.io/github/forks/tomshaw/laravel-gravatar?style=flat&logo=appveyor)
![stars](https://img.shields.io/github/stars/tomshaw/laravel-gravatar?style=flat&logo=appveyor)
[![GitHub license](https://img.shields.io/github/license/tomshaw/laravel-gravatar)](https://github.com/tomshaw/laravel-gravatar/blob/master/LICENSE)
## Installation
You can install the package via composer:
```bash
composer require tomshaw/laravel-gravatar
```## Usage
Configure the Gravatar Image where you plan on utilizing it.
```php
```> This generates an `60` pixels `retro` style image with a `g` rating.
## Parameters
The default parameters are described below:
- **`$email` (string)**: The email address of the user. This is required.
- **`$size` (int)**: The size of the Gravatar image in pixels. Default is `60`. Must be between `1` and `2048`.
- **`$default` (string)**: The default image to display if the user doesn't have a Gravatar. Default is `'mp'`. Options include: `'mp'`, `'identicon'`, `'monsterid'`, `'wavatar'`, `'retro'`, `'robohash'`, `'blank'`.
- **`$rating` (string)**: The rating of the Gravatar image. Default is `'g'`. Options include: `'g'`, `'pg'`, `'r'`, `'x'`.
- **`$secure` (bool)**: Whether to use the secure Gravatar URL. Default is `true`.
- **`$forceDefault` (string)**: Whether to always load the default image. Default is `'n'`.
- **`$forceExtension` (string)**: The file extension for the Gravatar image. Default is `'jpg'`.
## Requirements
The package is compatible with PHP 8 or later.
## License
The MIT License (MIT). See [License File](LICENSE) for more information.