crowdreactive/lob-bundle

A Symfony bundle for the Lob.com PHP SDK

2.0.0 2016-02-11 12:49 UTC

This package is not auto-updated.

Last update: 2024-11-09 19:56:17 UTC


README

Encapsulates Lob.com's PHP SDK in a Symfony bundle for configuration.

Bundled at CrowdReactive, makers of EventsTag.

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version SensioLabsInsight

Usage

  1. Install the bundle:

    composer require crowdreactive/lob-bundle
    
  2. Add it to AppKernel

    class AppKernel {
        public function registerBundles() {
            $bundles = [
                new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
                // ...
                new CrowdReactive\LobBundle\CrowdReactiveLobBundle(),
            ];
        }
    }
  3. Configuration

    crowd_reactive_lob:
        # Required
        api_key: abc123
    
        # Optional
        version: 1.5.0      # A specific version of the API
  4. Access the Lob service

    The Lob\Lob instance is named crowd_reactive_lob.lob in the dependency container. Access it with:

    $this->container->get('crowd_reactive_lob.lob');
    my_postal_service:
        class: My\PostalService
        arguments:
            -   "@crowd_reactive_lob.lob"

Contributing

PRs welcomed! Make sure to run the tests with composer run tests.

License

This bundle is under the MIT license. See the complete license.