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 5d 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

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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