Download the PHP package itsmg/rester without Composer

On this page you can find all versions of the php package itsmg/rester. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package rester

About Rester

Introducing RESTER, a Laravel package designed to simplify REST API interactions, providing a seamless and elegant way to handle API calls. Inspired by Laravel's Eloquent model approach, this package allows developers to define a model for each API call, mirroring the familiar structure of Laravel's table models.

Furthermore, the package supports grouping related API calls under a common parent class, enhancing code organization and reusability. By encapsulating REST API logic into manageable models, developers can effortlessly integrate external services.

Introduction

In this documentation, we'll demonstrate how to use RESTER with the example API, PaynowPaymentGateway, focusing on the PayNowCreateOrder class. With simple and elegant syntax, you can abstract API calls into manageable, reusable objects.

To install the RESTER package, use Composer:


1. Making an API Call with Minimal Code

With RESTER, you can call an API with as little as one line of code. Here’s how you can fetch an order creation API in the PaynowPaymentGateway example:

This single line handles everything — from making the request to processing the response. The PayNowCreateOrder class encapsulates all the necessary details for the API call.


2. Encapsulate API Logic, Focus on Business Logic

Developers should focus on business logic while RESTER handles the API interactions. You can encapsulate API call logic within a separate class, keeping your business logic clean and maintainable.

Artisan Command to Create API Call Class

This command generates a new PaynowPaymentGatewayBase & PayNowCreateOrder classes under the app/Rester/PaynowPaymentGateway/ directory (skipping the group folder creation if it already exists).

Example Base parent Class: PaynowPaymentGatewayBase

Example Class: PayNowCreateOrder


3. Assigning Default Payloads for API Calls

You can assign default payloads for every request. For instance, when creating an order, you might need to pass amount, currency & userid:

Now, every time you call PayNowCreateOrder, it automatically sends the default payload unless overridden.


4. Assigning Default Headers for API Calls

Headers, like authentication tokens, can be set by default, ensuring they are sent with every request:

Here, the Authorization header is automatically attached using an Auth token API call, making the process seamless for developers.


5. Dynamic Payload and Header Handling

You can easily customize payloads or headers dynamically during runtime. Here’s an example:

Dynamically Adding Payloads

Dynamically Adding Headers

This flexibility allows you to pass dynamic data and headers depending on your application’s state.


6. Exploring RESTER Builder Methods

RESTER also provides builder methods for further flexibility:

These methods give you full control over API URLs as your application's complexity grows.


7. Payload and Header Interception

RESTER offers a powerful feature to intercept payloads or headers before the API call is fired, making it easy to implement validation rules, caching, or formatting. You can also intercept and modify the response content before returning it to your business logic.

Example: Intercepting Payload

In this example, you can validate and encrypt the payload before it is sent.


8. API Access Logging

RESTER includes API access logging. You can enable or disable it using the $log property and specify what details should be logged.

This feature allows you to track API interactions for debugging or auditing purposes.


Conclusion

With RESTER, API integration in Laravel becomes a breeze. Whether you're sending dynamic payloads, managing authentication, or logging API access, RESTER allows you to focus on your business logic by abstracting the complexity of REST API calls into reusable, manageable components.


Security Vulnerabilities

If you discover a security vulnerability within Rester, please send an e-mail to Balamurugan via [email protected] . All security vulnerabilities will be promptly addressed.


All versions of rester with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/support Version ^11.0
illuminate/console Version ^11.0
guzzlehttp/guzzle Version ^7.0 || ^8.0
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package itsmg/rester contains the following files

Loading the files please wait ...