tormjens/posteio is a Laravel package for a php sdk for the poste.io api with support for laravel 5.
It currently has 0 GitHub stars and 9 downloads on Packagist (latest version 0.1).
Install it with composer require tormjens/posteio.
Discover more Laravel packages by tormjens
or browse all Laravel packages to compare alternatives.
Last updated
Poste.io is a full-featured mail server that features a REST API for tasks like creating mailboxes and adding domains.
composer require tormjens/posteio
If you're using Laravel 5.5, you can go ahead and skip to number 3.
config/app.php. 'TorMorten\Posteio\Providers\PosteioServiceProvider',
config/app.php 'Posteio' => TorMorten\Posteio\Posteio::class,
config/services.php 'posteio' => [
'host' => 'https://myhost.com',
'username' => '[email protected]',
'password' => 'secret'
],
Instantiate the class like so:
$posteio = new TorMorten\Posteio\Client('https://myhost.com', '[email protected]', 'secret');
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.
In Laravel the client is bound to the service container and can be instantiated in two different ways.
The first is via dependency injection.
Route::post('create-account', function(TorMorten\Posteio\Client $posteio) {
$posteio->boxes()->create(['name' => 'John Doe', 'email' => '[email protected]']);
});
The second is via resolving it via the service container.
app('posteio')->boxes()->create(['name' => 'John Doe', 'email' => '[email protected]']);
// or
app('TorMorten\Posteio\Client')->boxes()->create(['name' => 'John Doe', 'email' => '[email protected]']);