PHPackages                             hidayat/restclient - 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. hidayat/restclient

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

hidayat/restclient
==================

A Package for handling rest api request in laravel, This package provide interface over PHP cURL Api

014PHP

Since Aug 30Pushed 3y ago1 watchersCompare

[ Source](https://github.com/hidayat3676/laravel-restclient)[ Packagist](https://packagist.org/packages/hidayat/restclient)[ RSS](/packages/hidayat-restclient/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

laravel-restclient
==================

[](#laravel-restclient)

This provide calling rest api from laravel

` composer require hidayat/restclient `

usage
=====

[](#usage)

Include the facade provided by package in your class as belows

` use hidayat\restclient\Facade\Client; $url = "http://some-site.com";//simple GET request with no additional param$response = Client::call($url);dd($response)// GET request with  query param and headers$data = ['field1' => 'value1', 'field2' => 'value2'];$headers = ['Authorization: Basic ' . $token, 'accept: application/json'];``$response = Client::setGetData($data)->setHeaders($headers)->call($url);`

**Note: All methods are chainable except the call() method when setting any additional param call() method should be call at the end**

`//example with post method and post data$headers = ['content-type: application/x-www-form-urlencoded', Authorization: Basic ' . $token, 'accept: application/json'];``$postData = "field1=somevalue&field2=somefield2";`

**Note: when sending post data then there is no need to explicitly set method to post as it will be automatically set. When sending post request without any data you must set method to post**

`$response = Client::setPostData($postData)->setMethod('post') ->setHeaders($headers)->call($url);//PUT method example$response = Client::setPostData($postData)->setMethod('put')->setHeaders($headers)->call($url);//For url that require BasicHttpAuth you can use setHttpBasicAuthData method$basicAuthCred = ['username' => 'abc', 'password' => 'bdjdjdjd']$response = Client::setHeaders($headers)->setHttpBasicAuthData($basicAuthCred)->call($url);Since this package is an interface over PHP cURL Api you can set any of the cURL Options by passing an array to setOptions methodYou must provide Option key value pair format as below``$response = Client::setOptions([CURLOPT_SSL_VERIFYPEER => false,CURLOPT_TIMEOUT => 60])->call($url);`

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/hidayat-restclient/health.svg)

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

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M82](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M6.9k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M91](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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