Download the PHP package we-simply-code/laravel-afas-rest-connector without Composer

On this page you can find all versions of the php package we-simply-code/laravel-afas-rest-connector. 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-afas-rest-connector

What this package does

This package integrates the AFAS REST API with Laravel with a minimal setup.

Latest Version on Packagist

Table of Contents

Installation

After installation publish the config file

In the config file you can add different connections to the AFAS profitServices. One connection is added by default. If you will be using only one connection use the default connection. If you will be using multiple connections use the default connection for the connection you will be using the most to make things easier.

For each connection in the config file you will have to add the connectors. Each connection contains the getConnectors & updateConnectors array.

Add your connectors to these arrays. The key can be anything you want (you will use this as the name of the connector in your code), the value has to be the id of the connector in AFAS profitService.

Add the following variables to your .env file

Usage

I assume you know how the AFAS profitServices work and what the different connectors do. If not please take a look at the documentation for the AFAS REST API: https://help.afas.nl/help/EN/SE/App_Cnr_Rest_Api.htm?query=rest

This package ships with a facade to access the different connectors easily. After retrieving your connector you can apply filters to it or add data to it and then call the method to make the call to AFAS profitServices.

GetConnector

With the GetConnector you can retrieve data from AFAS profitService. The getConnector supports the simple filter, or the json filter. After configuring your getConnectors for your connection you can use the like this:

Filters

You can apply filters on getConnectors to retrieve more specific data. There is no specific order to apply filters. You can chain as many filters as you want except for the and filter. Those can only be used once per request. By default, this package will use the simple filter to retrieve results. You can enable the jsonFilter when your queries get a bit more advanced. Check out the official documentation about the differences between the simple filter and the jsonFilter: https://help.afas.nl/help/EN/SE/App_Cnr_Rest_GET.htm#o85263

Take

By default, the profitServices return 100 results. You can adjust the amount of results by adding the filter.

Skip

You can skip results by adding the filter.

SortOnField

Sort the results on any field. By default, the results will be ascending but with and extra parameter you can change that. Field names must be exact the same as they are in AFAS profitServices.

Where

If you want to get specific results from the getConnector you can use the filter (records must match all criterion). It is recommended to always use the filter with the getConnector as it enhances the performance and only gives you the results you need.

All AFAS Profit filters for the filter are available. The filters are listed in the config file. You can use them in their symbol form, or their text form.

By default, the getConnector uses the simple filter. To enable the jsonFilter you can pass as second parameter to the getConnector.

orWhere

You can use the filter to add another where clause to the filter (records must match at least one criterion). Please check out the official docs how this works.

Sometimes the simple filter isn't enough to query specific results. Enable the jsonFilter when doing advanced queries. The jsonFilter and the simple filter don't always return the same results!

Execute

The method is used when you have configured the connector accordingly to make the call to the AFAS profitServices.

This package uses Laravel's wrapper around Guzzle to make http calls. That means that after we call the method, we can use the methods Laravel provides to inspect the response. Example:

Check out the documentation for the Laravel http client: https://laravel.com/docs/8.x/http-client#introduction

Inspecting the where filter

If you want to inspect the json from the where filter you can call the method instead of the method after configuring the getConnector.

This method won't return the take, skip and sortOnField filter.

UpdateConnector

With the UpdateConnector you can insert, update or delete records from AFAS profitService. You can use a tool like https://connect.afas.nl to inspect the json object required to manipulate data in AFAS profitService, or you can call the method on the connector to inspect the fields.

Insert & Update records

Generating URL

If you want to inspect the URL that is being generated by the connector you can call the method instead of the method after configuring the connector.

MetaInfo

To inspect the meta info about a connector we can simply call the method.

Credits

Sunil Kisoensingh

License

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


All versions of laravel-afas-rest-connector with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3|^8.0|^8.1|^8.2
illuminate/support Version ^8|^9|^10|^11
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 we-simply-code/laravel-afas-rest-connector contains the following files

Loading the files please wait ....