PHPackages                             genericmilk/telephone - 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. genericmilk/telephone

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

genericmilk/telephone
=====================

Make simple API calls from Laravel!

1.6.0(5y ago)32.3kMITPHPPHP &gt;=7.0

Since Oct 21Pushed 4y ago1 watchersCompare

[ Source](https://github.com/genericmilk/telephone)[ Packagist](https://packagist.org/packages/genericmilk/telephone)[ RSS](/packages/genericmilk-telephone/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (6)Dependencies (1)Versions (12)Used By (0)

👴 This repo is archived and is no longer maintained as Laravel has run out a first party alternative that is way better! Switch to  to get started

📱 Telephone
===========

[](#-telephone)

By Genericmilk
--------------

[](#by-genericmilk)

Telephone is a lovely frontend to PHP's cURL that allows quick and easy GET and POST requests to JSON led api's!

### Why use this over cURL?

[](#why-use-this-over-curl)

Simple! While yes it's definetely possible to use cURL, this dramatically simplifies the process down to 1-3 lines of code and most importantly, respond as a PHP Object ready to go for navigation! It makes for a more readable more traversible request

### Install Telephone

[](#install-telephone)

To get started using Telephone you need to add it to your composer.json file. You can do this by running the following command

```
composer require genericmilk/telephone

```

This'll install the prerequisites to get Telephone working.

### Using Telephone

[](#using-telephone)

To get started using Telephone in your controller, You need to import it. Add this to the top of your controller to get started;

```
use Genericmilk\Telephone\Telephone;

```

Now that you've added Telephone to your controller, you can use it to build requests!

### Creating a GET request without authorisation using Telephone

[](#creating-a-get-request-without-authorisation-using-telephone)

Get requests using Telephone are made up of two parts, The `url` and any `headers` you want to use. If you have no header information you need to pass such as bearer tokens, You can make a request as such

```
$RingRing = Telephone::call('https://jsonplaceholder.typicode.com/photos/1')->get();

```

The value of `$RingRing` will be a PHP Object of the response the api delivered. You can then traverse it as such;

```
return $RingRing->url; // will return example photo from api call

```

And of course if you have more than one item in the response, simply iterate over it using a foreach like so;

```
foreach($RingRing as $Item){
  echo $Item->url;
}

```

### Creating a GET request with authorisation using Telephone

[](#creating-a-get-request-with-authorisation-using-telephone)

If you need to pass authorisation into your request, for example by means of a `Bearer Token` you can do so by adding it to the chain like so

```
$RingRing = Telephone::call('https://jsonplaceholder.typicode.com/photos/1')
->bearer('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx')
->get();

```

### Extending headers

[](#extending-headers)

If you need to add more to the headers array you can do so by adding the following

```
$RingRing = Telephone::call('https://jsonplaceholder.typicode.com/photos/1')
->headers([
  'Origin: https://nullstack.co.uk',
  'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36'
])
->get();

```

You can extend the header array as you need using this method. Any data will be sent along with the request

### Creating a POST request using Telephone

[](#creating-a-post-request-using-telephone)

Creating a POST request is pretty much similar to how GET requests are made, with the key difference there is space for another array which will be sent as `form-data` in the post request if you need.

You can use the request like so;

```
$RingRing = Telephone::call('https://jsonplaceholder.typicode.com/photos/1')
->bearer('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx')
->body([
  'Key' => 'Value',
  'AnotherKey' => 'AnotherValue'
])
->post();

```

You can scale up or down this request as you see fit. If you do not provide an array (i.e. a POST request without form-data) simply don't include it in your request like so;

```
$RingRing = Telephone::call('https://jsonplaceholder.typicode.com/photos/1')
->bearer('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx')
->post();

```

Telephone will not send any data if no array exists by default.

### Failed requests

[](#failed-requests)

If Telephone recieves anything outside of a `200`, by default it'll throw an exception. You can change this behaviour in a later version via the means of configs!

### Roadmap

[](#roadmap)

I really hope you love using Telephone. It should really aide with readability of your API requests and by converting data into a native PHP object speeds up the workflow! I've got plans to allow XML endpoints as well as more configuration and defaults, so if you have a common bearer token, you can add it to all requests meeting a certain pattern. Let me know your thoughts! Love you guys 🥰

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~48 days

Recently: every ~121 days

Total

11

Last Release

1913d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3cff61292b60883c06681d13acfaf0942d1cdbb9313a1a111a9f61f9618d9f60?d=identicon)[genericmilk](/maintainers/genericmilk)

---

Top Contributors

[![genericmilk](https://avatars.githubusercontent.com/u/1846127?v=4)](https://github.com/genericmilk "genericmilk (25 commits)")

---

Tags

apilaravelcurlgetpost

### Embed Badge

![Health badge](/badges/genericmilk-telephone/health.svg)

```
[![Health](https://phpackages.com/badges/genericmilk-telephone/health.svg)](https://phpackages.com/packages/genericmilk-telephone)
```

###  Alternatives

[vinelab/http

An http library developed for the laravel framework. aliases itself as HttpClient

59300.2k11](/packages/vinelab-http)[phpgt/fetch

Asynchronous HTTP client with promises.

3724.0k3](/packages/phpgt-fetch)[elementaryframework/water-pipe

URL routing framework and requests/responses handler for PHP

254.6k4](/packages/elementaryframework-water-pipe)

PHPackages © 2026

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