2017 © Pedro Peláez
 

package posteio

A PHP SDK for the Poste.io API with support for Laravel 5

image

tormjens/posteio

A PHP SDK for the Poste.io API with support for Laravel 5

  • Tuesday, October 3, 2017
  • by tormjens
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Poste.io PHP SDK

Poste.io is a full-featured mail server that features a REST API for tasks like creating mailboxes and adding domains., (*1)

Installation

  1. Install it using Composer
composer require tormjens/posteio

Using in Laravel

If you're using Laravel 5.5, you can go ahead and skip to number 3., (*2)

  1. Add the service provider to the providers array in your config/app.php.
    'TorMorten\Posteio\Providers\PosteioServiceProvider',
  1. Add the facade in config/app.php
    'Posteio' => TorMorten\Posteio\Posteio::class,
  1. Add the credentials in config/services.php
    'posteio' => [
        'host' => 'https://myhost.com',
        'username' => 'email@myhost.com',
        'password' => 'secret'
    ],

Outside Laravel

Instantiate the class like so:, (*3)

$posteio = new TorMorten\Posteio\Client('https://myhost.com', 'email@myhost.com', 'secret');

Usage

The API is split into two services; boxes and domains. Both have the same CRUD functions. You can find the complete documentation of what each resource takes a its parameters on their API docs/sandbox., (*4)

Laravel

In Laravel the client is bound to the service container and can be instantiated in two different ways., (*5)

The first is via dependency injection., (*6)

Route::post('create-account', function(TorMorten\Posteio\Client $posteio) {
    $posteio->boxes()->create(['name' => 'John Doe', 'email' => 'john@myhost.com']);
});

The second is via resolving it via the service container., (*7)

app('posteio')->boxes()->create(['name' => 'John Doe', 'email' => 'john@myhost.com']);
// or
app('TorMorten\Posteio\Client')->boxes()->create(['name' => 'John Doe', 'email' => 'john@myhost.com']);

TODO

  • Create a better readme.

The Versions

03/10 2017

dev-master

9999999-dev

A PHP SDK for the Poste.io API with support for Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel mail poste.io

02/10 2017

0.1

0.1.0.0

A PHP SDK for the Poste.io API with support for Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel mail poste.io