Easily generate URLs to Minecraft avatars with the ability to switch between services

Overview

Minecraft Avatar URLs

This library provides PHP utilities to generate URLs to Minecraft Avatars in different formats with the ability to easily change between avatar services.

Requirements

  • PHP 7.1 or higher
  • Composer

Installation

composer require gigadrive/minecraft-avatar-urls

Usage

use Gigadrive\MinecraftAvatar\MinecraftAvatar;

// Set default service to use
MinecraftAvatar::setDefaultService(MinecraftAvatar::SERVICE_MINOTAR); // minotar.net
MinecraftAvatar::setDefaultService(MinecraftAvatar::SERVICE_CRAFATAR); // crafatar.com
MinecraftAvatar::setDefaultService(MinecraftAvatar::SERVICE_CRAFTHEAD); // crafthead.net
MinecraftAvatar::setDefaultService(MinecraftAvatar::SERVICE_MCHEADS); // mc-heads.net
MinecraftAvatar::setDefaultService(MinecraftAvatar::SERVICE_CRAVATAR); // cravatar.eu

// Retrieve the default service class
$service = MinecraftAvatar::getDefaultService();

// Retrieve the default service class through global function
$service = avatar();

// Manually retrieve a service class
$service = MinecraftAvatar::getServices()[MinecraftAvatar::SERVICE_MINOTAR]; // minotar.net
$service = MinecraftAvatar::getServices()[MinecraftAvatar::SERVICE_CRAFATAR]; // crafatar.com
$service = MinecraftAvatar::getServices()[MinecraftAvatar::SERVICE_CRAFTHEAD]; // crafthead.net
$service = MinecraftAvatar::getServices()[MinecraftAvatar::SERVICE_MCHEADS]; // mc-heads.net
$service = MinecraftAvatar::getServices()[MinecraftAvatar::SERVICE_CRAVATAR]; // cravatar.eu

// Use service class
// Not all formats are available on all classes, check their websites for documentation
// Functions include phpDoc blocks.
$service->face("73b417dcd1e645d8af06895eeb5222a5", 16, true); // Returns a URL 16x16 face image of a player including the helm layer

Copyright and License

This program was developed by Mehdi Baaboura and published by Gigadrive UG under the MIT License. For more information click here.

You might also like...
Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

Introduction Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services. It handles almost all of the boilerpl

Laravel Cashier Paddle provides an expressive, fluent interface to Paddle's subscription billing services.

Introduction Laravel Cashier Paddle provides an expressive, fluent interface to Paddle's subscription billing services. It handles almost all of the b

Collection of Google Maps API Web Services for Laravel

Collection of Google Maps API Web Services for Laravel Provides convenient way of setting up and making requests to Maps API from Laravel application.

Laravel-veneer - A suite of mocked services to use in your Laravel tests.

Laravel Veneer A suite of fixture data and methods to help make mocking 3rd party services easier. Overview Laravel Veneer aims to solve two problems

A package for integrating Lazerpay services with your laravel application

This is my package lazerpay-laravel This is where your description should go. Limit it to a paragraph or two. Consider adding a small example. Support

Laravel package to generate and to validate a UUID according to the RFC 4122 standard. Only support for version 1, 3, 4 and 5 UUID are built-in.

Laravel Uuid Laravel package to generate and to validate a universally unique identifier (UUID) according to the RFC 4122 standard. Support for versio

Generate and autoload custom Helpers, Builder Scope, Service class, Trait

laravel-make-extender Generate and autoload custom helpers, It can generate multilevel helpers in the context of the directory. Generate Service class

A package to generate modules for a Laravel project.

Laravel Modular A package to generate modules for a Laravel project. Requirements PHP 7.4 or greater Laravel version 8 Installation Install using comp

Auto generate routes for Laravel Livewire components

livewire-auto-routes Auto generate routes for Laravel Livewire Components. Requirements Livewire 2 Laravel 8 php 8 Installation composer require tanth

Releases(v1.0.0)
Owner
Gigadrive UG
Software Development company based in Germany
Gigadrive UG
This package gives Eloquent models the ability to manage their friendships.

Laravel 5 Friendships This package gives Eloquent models the ability to manage their friendships. You can easily design a Facebook like Friend System.

Alex Kyriakidis 690 Nov 27, 2022
A Laravel package making a diagram of your models, relations and the ability to build them with it

Laravel Schematics This package allows you to make multiple diagrams of your Eloquent models and their relations. It will help building them providing

Maarten Tolhuijs 1.4k Dec 31, 2022
This tool gives you the ability to set the default collapse state for Nova 4.0 menu items.

Nova Menu Collapsed This tool gives you the ability to set the default collapse state for Nova 4.0 menu items. Requirements php: >=8.0 laravel/nova: ^

Artem Stepanenko 10 Nov 17, 2022
Generate services in Laravel with the artisan command

Laravel Service Generator Quickly generate services for your projects! Table of Contents Features Installation Usage Generate services Generate servic

Tim Wassenburg 15 Dec 2, 2022
Generate services and contracts in Laravel with the artisan command

What does it do? This package adds a new php artisan make:service {name} {--N|noContract} command. It will create a service file and its contract (int

Ludovic Guénet 18 Dec 21, 2022
Zarinpal is a laravel package to easily use zarinpal.com payment services in your applications

پکیج اتصال به درگاه پرداخت زرین پال zarinpal.com برای اتصال به درگاه پرداخت اینترنتی زرین پال و استفاده از api های آن می توانید از این پکیج استفاده کن

Rahmat Waisi 4 Jan 26, 2022
Boilerplate code for protecting a form with proof of work. Uses javascript in the browser to generate the hashcash and PHP on the server to generate the puzzle and validate the proof of work.

Boilerplate code for protecting a form with proof of work. Uses javascript in the browser to generate the hashcash and PHP on the server to generate the puzzle and validate the proof of work.

Jameson Lopp 28 Dec 19, 2022
A Laravel package for quickly adding .well-known URLs

A Laravel package for quickly adding .well-known URLs well-known is a Laravel package for quickly adding well-known locations (RFC8615) to a Laravel a

Kim Hallberg 2 Sep 13, 2022
Create CloudFront signed URLs in Laravel 6+

Easy to use Laravel 6+ wrapper around the official AWS PHP SDK which allows to sign URLs to access Private Content through CloudFront CDN

Dreamonkey S.r.l. 45 Dec 31, 2022
A Laravel (php) package to interface with the geo-location services at geonames.org.

geonames v7.x A Laravel (php) package to interface with the geo-location services at geonames.org. Major Version Jump I jumped several major versions

Michael Drennen 82 Nov 24, 2022