PHPackages                             rdj/client - 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. [API Development](/categories/api)
4. /
5. rdj/client

ActivePackage[API Development](/categories/api)

rdj/client
==========

This Package for Laravel Client Consume API (Web Service)

1.0.1(4y ago)82.4k2MITPHP

Since Jul 31Pushed 4y ago1 watchersCompare

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

READMEChangelog (2)Dependencies (2)Versions (5)Used By (0)

Laravel Client
==============

[](#laravel-client)

This Package for Laravel Client Consume API (Web Service)

[![](json-rest_schema.png)](json-rest_schema.png)

Requirement
-----------

[](#requirement)

In Your Project you must install `guzzlehttp/guzzle` version 6.2 or latest version.

Install Package Composer
------------------------

[](#install-package-composer)

#### There are 2 ways to install this package :

[](#there-are-2-ways-to-install-this-package-)

Install via "composer"

```
$ composer require rdj/client "dev-master"

```

#### or

[](#or)

Add the manual in composer.json

Step 1

```
{
   ...
   "require"{
        "rdj/client" : "dev-master"
   }
}

```

Step 2

```
$ composer update

```

Integration on Laravel Config
-----------------------------

[](#integration-on-laravel-config)

Register the Provider in the `config/app.php` file:

```
'providers' => [
	....

	Rdj\Client\ClientServiceProvider::class,
]

```

Add facade aliases in the same file `config / app.php`:

```
'aliases' => [
    ....

   'Client'    => Rdj\Client\Facades\Client::class,
]

```

Publish the package configuration file using the following command:

```
$ php artisan vendor:publish

```

Setting Enviroment (.env)
-------------------------

[](#setting-enviroment-env)

Edit file `.env` add the following code:

```
WEB_SERVER_URI=your_web_server_uri (e.g: https://webserver.com/ )
BASE=your_base (e.g: int/ or eks/ or mobile/ or api/v1/ )

```

How to use
----------

[](#how-to-use)

### In your controller:

[](#in-your-controller)

#### Get data from your web server without `authorization in header`:

[](#get-data-from-your-web-server-without-authorization-in-header)

```
....

use Client;

Class YourController extends Controller
{

....

   public function getData()
   {
      $getdata = Client::setEndpoint('your_endpoint')
                    ->setHeaders([])
                    ->setQuery([])
                    ->get();
        return response()->json( $getdata );
   }

}

```

#### Get data from your web server with `authorization in header`:

[](#get-data-from-your-web-server-with-authorization-in-header)

```
....

use Client;

Class YourController extends Controller
{

....

   public function getData()
   {
      $getdata = Client::setEndpoint('your_endpoint')
                    ->setHeaders(['authorization' => 'your_token'])
                    ->setQuery([])
                    ->get();
        return response()->json( $getdata );
   }

}

```

#### Get data from your web server with `authorization in header` and `parameter query`:

[](#get-data-from-your-web-server-with-authorization-in-header-and-parameter-query)

```
....

use Client;

Class YourController extends Controller
{

....

   public function getData(Request $request)
   {
      $search = $request->search;
      $getdata = Client::setEndpoint('your_endpoint')
                    ->setHeaders(['authorization' => 'your_token'])
                    ->setQuery(['search' => $search])
                    ->get();
        return response()->json( $getdata );
   }

}

```

#### Post data from your web server with `authorization in header` and `parameter body`:

[](#post-data-from-your-web-server-with-authorization-in-header-and-parameter-body)

```
....

use Client;

Class YourController extends Controller
{

....

   public function postData(Request $request)
   {
      $param_post = $request->all();
      $getdata = Client::setEndpoint('your_endpoint')
                    ->setHeaders(['authorization' => 'your_token'])
                    ->setBody($param_post)
                    ->post();
        return response()->json( $getdata );
   }

}

```

#### Multipart Post data from your web server with `authorization in header` and `parameter body`:

[](#multipart-post-data-from-your-web-server-with-authorization-in-header-and-parameter-body)

```
....

use Client;

Class YourController extends Controller
{

....

   public function postDataMultipart(Request $request)
   {
      $param_post = $request->all();
      $getdata = Client::setEndpoint('your_endpoint')
                    ->setHeaders(['authorization' => 'your_token'])
                    ->setBody($param_post)
                    ->post('multipart');
        return response()->json( $getdata );
   }

}

```

#### Delete data from your web server with `authorization in header` and `parameter body`:

[](#delete-data-from-your-web-server-with-authorization-in-header-and-parameter-body)

```
....

use Client;

Class YourController extends Controller
{

....

   public function DeleteData($id)
   {
      $getdata = Client::setEndpoint('your_endpoint/'.$id)
                    ->setHeaders(['authorization' => 'your_token'])
                    ->deleted();
        return response()->json( $getdata );
   }

}

```

Contributing
------------

[](#contributing)

1. Fork it ()
2. Create your feature branch (`git checkout -b feature/fooBar`)
3. Commit your changes (`git commit -am 'Add some fooBar'`)
4. Push to the branch (`git push origin feature/fooBar`)
5. Create a new Pull Request

License
-------

[](#license)

This Package have license under MIT License

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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 ~401 days

Total

3

Last Release

1679d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0a9a50c1f1f6cdc3dd1803c8c0f000ecf50db98acdbc1afb5c6dfb763dbe7340?d=identicon)[ranggadarmajati](/maintainers/ranggadarmajati)

---

Top Contributors

[![ranggadarmajati](https://avatars.githubusercontent.com/u/32367744?v=4)](https://github.com/ranggadarmajati "ranggadarmajati (12 commits)")

### Embed Badge

![Health badge](/badges/rdj-client/health.svg)

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

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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