2017 © Pedro Peláez
 

library laravel-shippo

Shippo for Laravel 5

image

bmartus/laravel-shippo

Shippo for Laravel 5

  • Wednesday, May 25, 2016
  • by bmartus
  • Repository
  • 1 Watchers
  • 13 Stars
  • 8,816 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 2 Open issues
  • 1 Versions
  • 11 % Grown

The README.md

Shippo for Laravel 5.2

Integrates the Shippo PHP library with Laravel 5.2 via a ServiceProvider., (*1)

Installation

Include laravel-shippo as a dependency in composer.json:, (*2)

"bmartus/laravel-shippo": "dev-master"

Run composer install to download the dependency., (*3)

Add the ServiceProvider to your provider array within app/config/app.php:, (*4)

'providers' => [
    ...
    Bmartus\LaravelShippo\LaravelShippoServiceProvider::class,
]

Configuration

Add the following to your .env file:, (*5)

SHIPPO_API_KEY=key_from_shippo

Usage

You may use the Shippo PHP Library as normal within your application. The Shippo API will automatically be configured with your API Key, so you do not need to set it yourself., (*6)

Example

A quick example in routes.php:, (*7)

<?php

Route::get('/address', function() {

    return \Shippo_Address::create([
        'object_purpose' => 'QUOTE',
        'name' => 'John Smith',
        'company' => 'Initech',
        'street1' => 'Greene Rd.',
        'street_no' => '6512',
        'street2' => '',
        'city' => 'Woodridge',
        'state' => 'IL',
        'zip' => '60517',
        'country' => 'US',
        'phone' => '123 353 2345',
        'email' => 'jmercouris@iit.com',
        'metadata' => 'Customer ID 234;234'
    ]);

});

The Versions

25/05 2016

dev-master

9999999-dev

Shippo for Laravel 5

  Sources   Download

MIT

The Requires

 

by Brandon Martus