PHPackages                             lee/service-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. lee/service-bundle

ActiveApi[HTTP &amp; Networking](/categories/http)

lee/service-bundle
==================

Intergated with mailing service,uploading image service and so on.

v1.4.1(7y ago)9407[4 issues](https://github.com/peter279k/serviceBundle/issues)MITPHPPHP &gt;=5.6

Since Jan 29Pushed 7y ago1 watchersCompare

[ Source](https://github.com/peter279k/serviceBundle)[ Packagist](https://packagist.org/packages/lee/service-bundle)[ RSS](/packages/lee-service-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (3)Versions (19)Used By (0)

serviceBundle
=============

[](#servicebundle)

[![Build Status](https://camo.githubusercontent.com/64382fac87ffd317ecd2ea33e2c0323e4c61ee39fbb30601079d11c85c126ddf/68747470733a2f2f7472617669732d63692e6f72672f70657465723237396b2f7365727669636542756e646c652e7376673f6272616e63683d76312e322e38)](https://travis-ci.org/peter279k/serviceBundle) [![Latest Stable Version](https://camo.githubusercontent.com/c0edc77d5389d1b183134269de4f12876dbcae22e9b60bd337a00b1add11571f/68747470733a2f2f706f7365722e707567782e6f72672f6c65652f736572766963652d62756e646c652f76657273696f6e)](https://packagist.org/packages/lee/service-bundle) [![Total Downloads](https://camo.githubusercontent.com/29f79487eb825f6d6bdd1a92e838a0b8e56e44f6ba560bb58bb1ccd9b6866ade/68747470733a2f2f706f7365722e707567782e6f72672f6c65652f736572766963652d62756e646c652f646f776e6c6f616473)](https://packagist.org/packages/lee/service-bundle) [![Latest Unstable Version](https://camo.githubusercontent.com/3d5f007de872c050641199ab919c691489b6b0b0427c6f4fcb58c23727429fcc/68747470733a2f2f706f7365722e707567782e6f72672f6c65652f736572766963652d62756e646c652f762f756e737461626c65)](https://packagist.org/packages/lee/service-bundle) [![License](https://camo.githubusercontent.com/bdc31bd6cd86ce1b3269f6a53aaae2ff4d7914e6a8350d9fde54412693d9466e/68747470733a2f2f706f7365722e707567782e6f72672f6c65652f736572766963652d62756e646c652f6c6963656e7365)](https://packagist.org/packages/lee/service-bundle) [![codecov](https://camo.githubusercontent.com/ce71a2ba75427a84c0c85402244c54cdd1ce091e3093331093a82784dbf82d1d/68747470733a2f2f636f6465636f762e696f2f67682f70657465723237396b2f7365727669636542756e646c652f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/peter279k/serviceBundle)[![Gitter](https://camo.githubusercontent.com/3c4fd34d8c14f152b214282b6f553dc221d61482bb74a42e681077476ff3e677/68747470733a2f2f6261646765732e6769747465722e696d2f70657465723237396b2f7365727669636542756e646c652e737667)](https://gitter.im/peter279k/serviceBundle?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

[![SensioLabsInsight](https://camo.githubusercontent.com/a3bbf70e7bdd88659031450116cbac3ad05c40cc3688ae71b74935dcb9ee2175/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f66323933373162612d616231632d343230332d383464332d3763393033653931393832342f6269672e706e67)](https://insight.sensiolabs.com/projects/f29371ba-ab1c-4203-84d3-7c903e919824)

Integrating with mailing service, uploading image service and so on.

It's based on [Guzzle](https://github.com/guzzle/guzzle),HTTP client.

Following service table is about supporting status
--------------------------------------------------

[](#following-service-table-is-about-supporting-status)

service-namesupportservice-type[mailgun](https://www.mailgun.com/)Yesmailing service[mailjet](http://dev.mailjet.com/guides/?php#about-the-mailjet-restful-api)Nomailing service[sendgrid](https://sendgrid.com/)Yesmailing service[Imgur](http://imgur.com/)Yesuploading images service[Imageshack](https://www.imageshack.us)Yesuploading images service[bit.ly](https://bitly.com/)Yesshorten url service[McAf.ee](https://community.mcafee.com/docs/DOC-1991)Yesshorten url serviceUsage
-----

[](#usage)

### Install Package

[](#install-package)

We strongly recommended using [composer](https://getcomposer.org)

Getting composer

```
curl -sS https://getcomposer.org/installer | php
```

Using this command

```
php composer.phar require lee/service-bundle
```

Sample code
-----------

[](#sample-code)

Mailgun: a sending mail service

```
require 'vendor/autoload.php';
$config = [
    'service-name' => 'Mailgun',
    //e.g. key-98dXXXXXXX
    'api-key' => 'mailgun-api-key',
    //e.g. sandbox5099cXXXXXXXXXXXXXXXXXXX
    'domain-name' => 'mailgun-domain-name',
    'from' => 'peter279k@gmail.com',
    'to' => 'peter279k@gmail.com',
    'subject' => 'Hello',
    //contents supported only plain text now.
    'contents' => 'Mailgun is awesome !'
];
$bundle = new \peter\components\serviceBundle\ServiceBundle($config);
//return json format (mailgun standard api response via cURL)
var_dump($bundle->sendReq());
```

SendGrid: a sending mail service

```
require 'vendor/autoload.php';
$config = [
    'api-key' => 'sendgrid-api-key',
    'from-name' => 'John Doe',
    'from-email' => 'john.doe@gmail.com',
    'to-name' => 'John Doe',
    'to-email' => 'john.doe@gmail.com',
    'subject' => 'SendGrid Test',
    'contents' => 'Sendgrid is awesome!',
];
$service = (new peter\components\serviceBundle\Services\ServiceFactory)->create('SendGrid');
$service->setConfig($config);
//return json format (SendGrid standard api response via cURL)
var_dump($service->sendReq());
```

Mailjet: a sending mail service

```
require 'vendor/autoload.php';
$config = [
    'api-key-public' => 'mailjet-public-api-key',
    'api-key-private' => 'mailjet-privave-api-key',
    'from-name' => 'John Doe',
    'from-email' => 'john.doe@gmail.com',
    'to-name' => 'John Doe',
    'to-email' => 'john.doe@gmail.com',
    'subject' => 'Mailjet Test',
    'contents' => 'Mailjet is awesome!',
];
$service = (new peter\components\serviceBundle\Services\ServiceFactory)->create('Mailjet');
$service->setConfig($config);
//return json format (Mailjet standard api response via cURL)
var_dump($service->sendReq());
```

Imgur: an uploading images service

```
require 'vendor/autoload.php';
$config = [
  	'service-name' => 'Imgur',
  	'clientID' => 'imgur-client-id',
  	'filePath' => '/path/to/image.png'
];
$bundle = new \peter\components\serviceBundle\ServiceBundle($config);
//return json format (Imgur standard api response via cURL)
var_dump($bundle -> sendReq());
```

ImageShack: an uploading images service

```
require 'vendor/autoload.php';
$config = [
  	'service-name' => 'ImageShack',
  	'key' => 'your-Imageshack-api-key',
  	//specify the image max file size
  	'maxFileSize' => '5242880'
  	'filePath' => '/path/to/image.png'
];
$bundle = new \peter\components\serviceBundle\ServiceBundle($config);
//return json format (Imgur standard api response via cURL)
var_dump($bundle -> sendReq());
```

McAfee: a shorten url service

```
require 'vendor/autoload.php';
$config = [
  	'service-name' => 'McAfee',
  	'longUrl' => 'your-long-url'
];
$bundle = new \peter\components\serviceBundle\ServiceBundle($config);
//return json format (McAf standard api response via cURL)
var_dump($bundle->sendReq());
```

Bitly: a shorten url service

```
require 'vendor/autoload.php';
$config = [
  	'service-name' => 'Bitly',
  	'login' => 'your-login',
  	'apiKey' => 'your-api-key',
  	'longUrl' => 'your-long-url'
];
$bundle = new \peter\components\serviceBundle\ServiceBundle($config);
//return json format (bit.ly standard api response via cURL)
var_dump($bundle -> sendReq());
```

Run TestCase
------------

[](#run-testcase)

```
composer test

```

### Changelog

[](#changelog)

#### 2016/07/20

[](#20160720)

- version: v1.2.7
- Using the new version of Guzzle 5 and avoid the Httpoxy vulnerability.

#### 2016/07/21

[](#20160721)

- version: v1.2.8
- Fix the uploading image via imgur service bug.

#### 2016/07/21

[](#20160721-1)

- version: v1.2.9
- adding some information images

#### 2016/07/21

[](#20160721-2)

- version: v1.3.1
- supporting the Imageshack API

#### 2017/11/11

[](#20171111)

- version: v1.4.0
- Change the namespace and see the sample code to know this.
- Change the source code(code refactoring)
- Using the PHPUnit `Mock` to test the HTTP API requests.
- The version 2.x is deprecated.
- Update the Guzzle version to 6.2
- Change the `service-name` value in `$config` array.

Version Guidance
----------------

[](#version-guidance)

VersionStatusPackagistNamespacePSR-71.xMaintained`lee/service-bundle``peter\components\serviceBundle`No2.x\*\*Deprecated`lee/service-bundle``peter\components\ServiceBundle`No[serviceBundle-1-repo](https://github.com/peter279k/serviceBundle/tree/master)

[serviceBundle-2-repo(deprecated)](https://github.com/peter279k/serviceBundle/tree/guzzle6)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance11

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 75.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~61 days

Recently: every ~202 days

Total

17

Last Release

2776d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/baa74b27c760b02871b04908382ae01967e7d7100c20144c71197cd680b99c98?d=identicon)[peter279k](/maintainers/peter279k)

---

Top Contributors

[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (129 commits)")[![joefearnley](https://avatars.githubusercontent.com/u/78153?v=4)](https://github.com/joefearnley "joefearnley (35 commits)")[![ender503](https://avatars.githubusercontent.com/u/1849431?v=4)](https://github.com/ender503 "ender503 (5 commits)")[![mstruebing](https://avatars.githubusercontent.com/u/12071529?v=4)](https://github.com/mstruebing "mstruebing (1 commits)")

---

Tags

composerguzzleimageshackimgurmailgunshorten-urls

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lee-service-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/lee-service-bundle/health.svg)](https://phpackages.com/packages/lee-service-bundle)
```

###  Alternatives

[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[omniphx/forrest

A Laravel library for Salesforce

2724.4M8](/packages/omniphx-forrest)[akamai-open/edgegrid-client

Implements the Akamai {OPEN} EdgeGrid Authentication specified by https://developer.akamai.com/introduction/Client\_Auth.html

482.5M6](/packages/akamai-open-edgegrid-client)[muhammadhuzaifa/telescope-guzzle-watcher

Telescope Guzzle Watcher provide a custom watcher for intercepting http requests made via guzzlehttp/guzzle php library. The package uses the on\_stats request option for extracting the request/response data. The watcher intercept and log the request into the Laravel Telescope HTTP Client Watcher.

98239.8k1](/packages/muhammadhuzaifa-telescope-guzzle-watcher)[ory/hydra-client-php

Documentation for all of Ory Hydra's APIs.

1710.8k](/packages/ory-hydra-client-php)[meteocontrol/vcom-api-client

HTTP Client for meteocontrol's VCOM API - The VCOM API enables you to directly access your data on the meteocontrol platform.

175.7k1](/packages/meteocontrol-vcom-api-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
