Download the PHP package rapkis/laravel-controld without Composer

On this page you can find all versions of the php package rapkis/laravel-controld. 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 laravel-controld

Access the ControlD API in your Laravel application

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Access the ControlD API in your Laravel application.

This is not an official package and is purely a third-party API client. Any service-related issues should be directed towards the service provider itself.

Installation

You can install the package via composer:

You should publish the config file with:

This is the contents of the published config file:

Make sure to define the ControlD endpoint and your API token in the .env file. You can also set up middleware classes that will be applied to your HTTP requests and responses (see Middleware).

Usage

To access the ControlD API you first need to have an account created. Visit controld.com. Make sure you're familiar with their documentation and API reference. The package assumes you understand with how the service and the API work.

Quick Start

The main class you'll be working with is \Rapkis\Controld\ControlD. You can access all ControlD endpoints by using its methods. Endpoints are organized according to the documentation for ease of use.

Start by instantiating it:

\Rapkis\Controld\ControlD depends on Laravel's HTTP client, which is configured automatically via \Rapkis\Controld\ControlDFactory. To make things simple, it is recommended to resolve it via Laravel's Service Container (a.k.a. app(), Dependency Injection, etc.) to instantiate the \Rapkis\Controld\ControlD class. It's already pre-configured in \Rapkis\Controld\ControldServiceProvider.

Now, you can make API requests

General structure

In a nutshell, the package is made up of "Resources" and "Responses". Resource classes are used to make HTTP requests and then JSON responses are mapped to Response classes. These classes are basic DTOs (data transfer objects) which are easier to work with than basic arrays: you don't have to guess array keys and can immediately understand the response structure.

Each method in the \Rapkis\Controld\ControlD class corresponds to the appropriate Resource class (\Rapkis\Controld\Resources). Resource classes make the requests and map the responses to the response classes. Usually with the help of factory classes.

Middleware

Just like with the Laravel's HTTP client (or Guzzle), you can add middlware to interact with your requests and responses. You can check how they work in the Laravel documentation

For example, this package handles ControlD specific errors with \Rapkis\Controld\Middleware\ControlDErrorHandlerMiddleware. Instead of parsing the JSON response somewhere in your code, you can parse it in the middleware class and handle your errors before returning a response.

Feel free to modify the middleware or add your own! For example, you can have middleware which renders error-specific exceptions instead of the generic one. Alternatively, if you're running an organization, you can add the impersonation header (X-Force-Org-Id: org_id_goes_here) directly via middleware.

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-controld with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
guzzlehttp/guzzle Version ^7.7
illuminate/contracts Version ^10.0
spatie/laravel-package-tools Version ^1.14.0
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 rapkis/laravel-controld contains the following files

Loading the files please wait ....