vluzrmos/badge-poser

Laravel and Lumen Badge Generator

v1.0.1 2015-06-24 21:47 UTC

This package is auto-updated.

Last update: 2024-10-13 05:59:47 UTC


README

Join the chat at https://gitter.im/vluzrmos/laravel-badge-poser

Latest Stable Version Total Downloads Latest Unstable Version License

That package is a easy wrapper to Badges/Poser.

#Installing

composer require vluzrmos/laravel-badge-poser

Laravel

configure the aliases and providers on Laravel config/app:

The provider:

  'Vluzrmos\BadgePoser\BadgePoserSeviceProvider',

and the alias:

  'Poser' => 'Vluzrmos\BadgePoser\PoserFacade',

Lumen

edit the bootstrap/app.php:

$app->register('Vluzrmos\BadgePoser\BadgePoserSeviceProvider');

//register the facade, if you need
if(!class_exists('Poser')){
  class_alias('Vluzrmos\BadgePoser\PoserFacade', 'Poser');
}

Usage

Using IoC Container

class YourController extends Controller
{
  public function controllerMethod(\Vluzrmos\BadgePoser\Contracts\Poser $poser)
  {
    return $poser->generate('slogan', 'status', 'FFFFFF', 'flat');
  }
} 

Facade

$response = Poser::generate('licence', 'MIT', 'FFFFF', 'plastic');

API

$response = Poser::generate($message, $status, $color, $format);
//where $format is 'flat' or 'plastic'


$response = Poser::generateFromURI('license-MIT-428F7E.plastic');

Example

Lumen Slackin.

License

DBAD.