Download the PHP package artdarek/avatarer without Composer

On this page you can find all versions of the php package artdarek/avatarer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package avatarer

Avatarer - Social media avatars for Laravel 5

Easy get avatars from social services like Facebook.com and Gravatar.com


Supported Providers

A Provider can be a social network service that allows to get it's users avatars. As for right now we support:

Installation

Via composer require command

Use composer require command to install this package.

Adding package to composer.json file manually

Add package to your composer.json file:

Use composer update command to install this package.

Registering the Package

Add the Avatarer alias into your config file config/app.php:

Usage

Initialize

To ininitialize Avatarer call make() method and pass Provider name (service name like Gravatar/Facebook/Twitter):

If you want to use Avatarer library outside of Laravel framework or you don't want to use Avatarer Facade in your Laravel application, you can do this:

or

or

Setting a user

Generating avatar with default settings is very simple and all you have to do is to call user() method with user id as a parameter (each Provider can identify user differently via email/id/screenname etc.):

For Gravatar we use Email:

For Facebook we use UserID:

For Twitter we use user ScreenName:

Setting avatar size

If you want to set a size of avatar that should be returned you can use size() method. This method can take two parameters width and height and both are optional (notice that not all providers will require or use both width and height, for example Gravatar expects only width).

For Gravatar:

For Facebook:

Setting provider-specific options

If you want to customize avatar a little bit more you can set some additional parameters using options() method.

For Gravatar:

For Facebook:

Methods chaining

If thats more convinient for you you can chain all methods like below:

Output Formating

Default string output

With Avatarer by using get() method you can get url string of user avatar:

Changing output format

If you wish to get output in different format like Array, Json or even HTML code you can do that by calling get() method with Output object that implements OutputInterface as a parameter:

To get Array (add use \Artdarek\Avatarer\Output\ToArray; at the top of your class):

To get JSON (add use \Artdarek\Avatarer\Output\ToJson; at the top of your class):

To get Object (add use \Artdarek\Avatarer\Output\ToObject; at the top of your class):

To get HTML (add use \Artdarek\Avatarer\Output\ToHtml; at the top of your class):

If you want to have more controll over returned HTML code you can pass array with additional attributes via ToHtml() constructor, for examle:


All versions of avatarer with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version ~5.1
php Version >=5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package artdarek/avatarer contains the following files

Loading the files please wait ....