Download the PHP package masterskill/afa-api-laravel without Composer

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

AFAcodes Cameroon API

API v0.2.1 from the AFACodes

Endpoints and functionalities of the Logistic Grid, syntax “CM-$etc”. For Scientific Grid (syntax “CM+$etc”) and covers, see next documentation. We use, instead a Swagger, the “page endpoint” that is self-explanatory.

Installation

With composer

City Querying

For querying a city, you should initialize the cityQuery class.

Make sure you have the App\Models\City on the project.

Level

For the level correspondance, it depends on the side you want it.
From application, we use all these level, that is all the point of view from the user :

Side

From AFACode, there is no level defined. Instead, they use side for the point of view.
With that, we need to make sure we transform all level into side
Below the SIDE and LEVEL relation.

To push it a little further, below the calculation.

Centroid

Each city or point in the API will be assigned a centroid. This centroid can be used everywhere, but you can be sure there is always this centroid. You can calculate the centroid of point dirrectly too, but make sure to have the coordinatees in form of an array of lon / lat object.

To calculate it manually, you have the helper \Masterskill\AfaApiLaravel\Helpers\Centroide, and call calculateCentroid method statically.

Cell

A cell is a portion of territory in the AFACode API. You can get the cell either with the longitude and lattitude or directly with the BANOC code directly, both will generate a cell. The difference is that we often use the BANOC Code if we search a city or something we know the format, and we use the GeoQuery if we want to use a lon / lat format.

Make sure you instanciate the CellByGeoQuery class before using it. When you pass the lon and lat and eventually the level, for exemple lon : 11.20524 and lat : 1.6580, it will be processed to make sure that the request will be valid in the AFACode API.

Thanks

Thanks for AFACode for their beautifull API. You can check their tools at https://afa.codes.

For example, in Yaoundé region, we can have https://afa.codes/CM-YE4-6DS


All versions of afa-api-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
spatie/laravel-package-tools Version ^1.16
guzzlehttp/guzzle Version ^7.2
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 masterskill/afa-api-laravel contains the following files

Loading the files please wait ....