PHPackages                             masterskill/afa-api-laravel - 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. masterskill/afa-api-laravel

ActivePackage[API Development](/categories/api)

masterskill/afa-api-laravel
===========================

A package for the AFA Code API Integration, that needs to interacts with it's database and existing database

3.0.3(7mo ago)040MITPHPPHP ^8.1

Since Sep 27Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/masterSkill77/afa-api-laravel)[ Packagist](https://packagist.org/packages/masterskill/afa-api-laravel)[ RSS](/packages/masterskill-afa-api-laravel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (30)Used By (0)

AFAcodes Cameroon API
=====================

[](#afacodes-cameroon-api)

API v0.2.1 from the AFACodes
============================

[](#api-v021-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
============

[](#installation)

With composer

```
composer require masterskill/afa-code-laravel
```

City Querying
-------------

[](#city-querying)

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

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

```
use Masterskill\AfaApiLaravel\Domains\Http\City\CityQuery;

$cityQuery = new CityQuery();

$query ="CM-SOA";

$result = $cityQuery->query($query);

print_r($cityQuery);
```

Level
-----

[](#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 :

- 180 : 1m
- 155 : 6m
- 130 : 30m
- 105 : 200m
- 80 : 1km

Side
----

[](#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.

- 0.5 : 180
- 2.5 : 155
- 16 : 130
- 90.5 : 105
- 512 : 80

To push it a little further, below the calculation.

```
    switch (($side)) {
        case $side < 2.5:
            return 180;
        case    2.5
